Hi! I´m using repeatable regions for the first time, i´m trying to make an option for the clients to create contact form fields by their own, so far everythig works fine, I have this code:
But there are a few details:
1. Is there any way i can get the value of the "title" editable region but with all letters lowercase and without spaces (something like the name of a cloned page that is automatically created from its title) so i can use this for the value of the "name" attribute of the input? this is trying to reduce the number of editable regions (for better display in the admin since the repeatable regions display in tables and to many regions doesn´t look fine).
2. When trying to use this <cms:if k_error_<cms:show name/>> i get an error, how could i put this value there?
thanks
- Code: Select all
<!-- this code to set the editable regions -->
<cms:repeatable name="form" label="Form fields" group="formulario" order="1">
<cms:editable name="title" label="Label for the input field" type="text"/>
<cms:editable name="name" label="Name for the input field" desc="This text shouldn´t contain spaces or capital letters" type="text"/>
<cms:editable name="required" label="Required field?" type="radio" opt_values='Si| No' />
<cms:editable name="text" label="Display this text if a field have been left empty" type="text" />
</cms:repeatable>
<!-- This code to display the values -->
<cms:show_repeatable 'form' >
<div class="col-sm-4">
<div class="form-group">
<cms:dump/>
<label for="<cms:show name/>"><cms:show label/></label>
<cms:input type="text" name="<cms:show name/>" id="<cms:show name/>" class="form-control" required="1"/>
<cms:if k_error_<cms:show name/>>
<div class="alert alert-danger">
<p id="<cms:show name/>_error" class="error"><cms:show text/></p>
</div>
</cms:if>
</div>
</div>
</cms:show_repeatable>
But there are a few details:
1. Is there any way i can get the value of the "title" editable region but with all letters lowercase and without spaces (something like the name of a cloned page that is automatically created from its title) so i can use this for the value of the "name" attribute of the input? this is trying to reduce the number of editable regions (for better display in the admin since the repeatable regions display in tables and to many regions doesn´t look fine).
2. When trying to use this <cms:if k_error_<cms:show name/>> i get an error, how could i put this value there?
thanks