Problems, need help? Have a tip or advice? Post it here.
4 posts Page 1 of 1
Is it possible to add a placeholder to an editable region of type text or textarea?
Sure.
Assuming following are the two editable regions we are interested in -
Code: Select all
<cms:template>
    <cms:editable name='name' type='text' />
    <cms:editable name='address' type='textarea' />
</cms:template>

Use <cms:config_form_view> to custom render them adding the 'placeholder' parameters as follows -
Code: Select all
<cms:template>
    <cms:editable name='name' type='text' />
    <cms:editable name='address' type='textarea' />
   
    <cms:config_form_view>
        <cms:field 'name'>
            <cms:input name=k_field_input_name type='bound' trust_mode='1' placeholder='First name' />
        </cms:field>

        <cms:field 'address'>
            <cms:input name=k_field_input_name type='bound' trust_mode='1' placeholder='Full address' />
        </cms:field>
    </cms:config_form_view>
</cms:template>

Result:
Untitled-1.png
Untitled-1.png (3.57 KiB) Viewed 96 times

Hope it helps.
Yes! That works! Thank you so much. I didn't see anything about config_form_view in the documentation, must have missed it!
You are welcome :)

I didn't see anything about config_form_view in the documentation,

You can find all the details about <cms:config_form_view> and its counterpart <cms:config_list_view> here -
viewtopic.php?f=5&t=10241

Basically both allow easy customization of the form and list screens in the admin-panel.
4 posts Page 1 of 1

Who is online

In total there are 2 users online :: 0 registered, 0 hidden and 2 guests
(based on users active over the past 5 minutes)

Users browsing this forum: No registered users and 2 guests