How to add options and values in to the selector box element of Flexible content element(FCE)?
How to use that value in other element's typoscript?
How to add options and values in to the selector box element of Flexible content element(FCE)?
Edit field and click Form link:
How to use that value in other element's typoscript?
for ex. in other element TS
10 = TEXT
10.field = field_2bf3c2
where field_2bf3c2 id field name look at image.
Related
I need to use a selector that can help me get the value of a field of the page type I have added in the content tree.
For example: If I add a page type CMS.News in content tree and set the value of the "Title" field to be "test". So which selector should I use to get the value "test" of the field "Title"?
Thanks in advance.
The easiest will be to use simple Drop-down list control and use Macro expression or SQL query (depends on if you want to retrieve custom field). I will assume that you need custom field, so you can try something like this:
Documents.WithAllData.Columns("Title").Where("ClassName='CMS.News'")#
where Item transformation and Value column fields contains field name that you need: {% Title %}
I'm using web2py to create an SQLFORM which updates some (currently empty) text fields:
form = SQLFORM(db.table, db.table(1), fields = ['blank_name'])
Which creates a textarea tag with name='blank_name'. I then want to set the default text for this text area to some variable. So I've tried
form.element(_name='blank_name').update(_value='My default value')
but this just sets the 'value' attribute of the textarea to 'My default value'. How can I set the contents of the previously blank textarea to a value?
The simplest approach is simple to set the field default (before creating the form):
db.table.blank_name.default = 'My default value'
Regarding the original approach, the web2py HTML helpers act like lists with regard to their components (i.e., contents), so you could use the .append or .insert methods to update the contents.
I want to add an attribute to a radio-button form input. I want to add jquery validation to them. When I specify the attr in the form_widget function in twig, the attributes are applied to the div where the input elements are in.
How do I apply the attributes to the input element?
I tried to set the field "Sample Data" on the "Configuration" page when mapping a data element with Templavoila. But it seems it is used for something else.
Is it possible to define default values for fields like "Plain input field"?
Open the Templavoila DS/TO editor, select your field and add following to "Form"
<default>Your default value</default>
Heres an example:
I have some subpages where there is a single content element with a header in HTML H1.
How can I set the header of this content element to the page's title?
We used a typoscript marker for that. Just define it in your page template and then fill it with the title like this:
PAGE-TITLE = TEXT
PAGE-TITLE.field = nav_title // subtitle // title
Instead of relying on Content Element (CE) (which de facto may exist OR not AND can have any header set OR not) it's better to... use Michael's suggestion and on the selected branch use the modified template, and place ###PAGE-TITLE### marker just before the marker where you are rendering-in your ContentElements.
In that case you don't need to modify the way that your <title> tag is created and you have sure that title always exists and you can be sure that there's always some title.
Of course you'll need to set the default header of the first CE as hidden (or leave it empty), however you can do it for whole branch with PageTS.