PyroCMS Language Tag to display the language code - pyrocms

I'm using PyroCMS Pro 2.2.6. I created in a PyorCMS Stream a language field which I would like to use in my template to display the language code (en, de, fr, etc.):
I tried many different tags like:
{{ web_language }}
{{ web_language:name }}
{{ web_language:value }}
{{ web_language:key }}
{{ web_language:code }}
Only the first one worked and displayed the language value (English, Germany, etc.). Which tag can I use to display the language code?
BTW there seems to be missing the label above the radio buttons when you choose PyroCMS Language as field type.

Related

Crispy forms CheckboxSelectMultiple display inline

I am having a lot of difficulty getting a MultipleChoiceField list to display inline using crispy. I have tried adding div's between by displaying the form using
{{ for field in form }}
but it places the div's between each selectbox AND the select boxes label.
This is where I create the CheckboxSelectMultiple:
preferred_topics = forms.MultipleChoiceField(choices=TOPICS, required=False, widget=forms.CheckboxSelectMultiple())
And I am printing it out with:
{{ form|crispy }}
I also have many other form types before and after this field (text boxes etc)
Thank you.
You will probably need to use the {% crispy %} tags and FormHelper. This will allow you to use InlineField.
There is also the table option which doesn't use divs.

What is the syntax to create a pdf link in _config.yml

I am using Jekyll to create a personal website. I am using the Beautiful-Jekyll template that is very popular. There is a navigation bar already defined in _config.yml. I want to make Resume link to my resume pdf.
I have accomplished that with this code (in _config.yml):
# List of links in the navigation bar
navbar-links:
Moi: "aboutme"
Projects:
- Hell Game: "http://deanattali.com/beautiful-jekyll/"
- Success City: "http://www.markdowntutorial.com/"
Resume: "Tech Resume.pdf"
However, this only opens the resume in the same tab. I want it to open in a separate tab. In HTML, you achieve this by using target="_blank". How do I do this in YAML?
I tried this but my index.html actually doesn't use links. I know, weird.
beautiful-jekyll/_includes/nav.html line 26:
{{ linkparts[0] }}
Change it into:
<a href="{{ linkparts[1] | relative_url }}"
{% if linkparts[1] contains '.pdf' %}target="_blank"{% endif %}
>{{ linkparts[0] }}</a>
Or use this (java)script/solution:
https://jekyllcodex.org/without-plugin/new-window-fix/

OctoberCMS -> Access to a different Pages->Content Tab

i have a small problem. I created a partial that gives me out all pages. Now i want to give out the Content from the different Pages. All pages have a tab that named "Image", but i don't know how access to
Layout
{% for child in page.getChildren %}
<li class="list-group-item">
<span>
<!-- Here the Content of the Tab "Image" -->
</span>
<a href="{{ child.url|app }}">
ClickMe
</a>
</li>
{% endfor %}
Page
So can you help me to access to the right Tab? I already tried these one (but i only can access to the content tab)
{{ child.content }}
this doesn't worked for me
{{ child.Tab.Image }}
or
{{ child.Image }}
If you use placeholder, you can only insert text in backend newly created tab. The best way to create an image custom field in your page (I assume that you are using Static Pages plugin, like you photo suggests) is use this syntax:
{variable name="image" label="Image" tab="The name of your tab here" type="mediafinder" mode="image"}{/variable}
Remember to put this code in you layoutfile.
You can find all of your needs in plugin's documentation here and here.
Remember that you can use all of OctoberCMS's built in form fields (yeah, also repeater!)

Troubles with HTML-tags in post content in octobercms frontend

I'm trying to display my terms' content on the page using component 'TermsDescription'.
I try this code on my page :
<...> {% component 'TermsDescription' %} <...> {% component 'TermsDescription|raw' %} <...>
But display same as screen-shot
my content is displayed with <.p> tag. So, tags displayed as text, not as HTML-tags at all. I have either 'only text' without decoration, or pure tags-as-a-text on the page. What am I missing? Where is the solution? :)
You can not use raw in defining component like this {% component 'TermsDescription|raw' %}.
Instead of this, you should have to understand the components in OctoberCMS.
Suppose you are passing data from your TermsDescription component.
$this->page['data']= /Data::find($id);
And it contains title and description. And Description has data as seen in your question.
Then you can do this way
{{ data.description|raw' }} where you want to print description.

Form::password in Laravel Blade Templates

I was trying to create a password field in the form in Laravel Blade templates but the output doesn't let me enter anything and it's not showing any placeholder either. The code doesn't cause any error.
Form:
{{ Form::open(array('class'=> 'forming')) }}
{{ Form::text('username','Username',array('class' => 'insi')); }}<br>
{{ Form::password('password',array('placeholder'=>'Password','class' => 'insi')); }}
{{ Form::close() }}
and the output is like that. Any help?
Second Input form is for password.
We are not seeing your generated HTML, but usually those problems are related to your HTML. For instance, you are using a CSS class 'insi', which may not letting you see the password characters.
To do a test remove/disable your CSS files from your main HTML and it probably will work fine.

Resources