by
KK » Tue Jun 26, 2018 3:38 am
@andrejprus, @larin555,
When a field is defined within a repeatable_region, the 'field' as seen by <cms:config_form_view> is actually the repeatable-region (and not its children). That would explain why the method does not work with child regions.
Anyway, we can use an alternate (albeit slightly more involved) method to set custom attributes on 'text' and 'textarea' regions.
This method is a variation of the method described here -
viewtopic.php?f=2&t=10438&p=25693#p25696So, if you have not already done this, begin with activating the 'sample' admin theme by uncommenting (i.e. removing the leading double-slashes '//') the line highlighted below in couch/config.php -
// 26.
// If the admin-panel uses a custom theme, set the following to the folder-name of the theme.
// Theme folder is expected to be within the 'couch/theme' folder. No leading or trailing slashes please.
//define( 'K_ADMIN_THEME', 'sample' );
Now place the attached three files within the 'couch/theme/sample' folder.
IMP: If you have already made any custom changes to the existing 'kfunctions.php' within the 'couch/theme/sample' folder mentioned above, please manually add to your existing file the new changes from the attached 'kfunctions.php' file.And now, suppose the original definition of a text/textarea editable region is as follows -
- Code: Select all
<cms:editable type='text' name="url" label='URL on page' />
- you may add any custom attribute to it by using the 'custom_styles' attribute as follows -
- Code: Select all
<cms:editable type='text' name="url" label='URL on page' custom_styles="placeholder='https://'" />
Any text placed between the two double-quotes of 'custom_styles' attribute will be outputted verbatim in the generated input's HTML.
Please note that the technique above will work for normal text/textarea editable regions as well as those defined as repeatable.
Hope this helps.