Hi,
I am trying to setup a ladder of some sort.. I have setup a back end form to fill in the required details but I needed to use a repeatable area as I don't know of any table feature in couch cms..
I can grab all the data out of the repeatable element, but i am unable to sort the output by the data in the repeatable area.. any help would be greatly appreciated.
The output page code section
I am trying to setup a ladder of some sort.. I have setup a back end form to fill in the required details but I needed to use a repeatable area as I don't know of any table feature in couch cms..
I can grab all the data out of the repeatable element, but i am unable to sort the output by the data in the repeatable area.. any help would be greatly appreciated.
- Code: Select all
<?php require_once( 'admin/cms.php' ); ?>
<cms:template title='Ambassadors' clonable='1'>
<cms:editable name='name' label='Ambassador Name' required='1' type='text' order='1' />
<cms:editable name='email' label='Ambassador Email' required='1' validator='email' type='text' order='2' />
<cms:editable type='richtext' label='Ambassador Bio' name='bio' order='3' />
<cms:editable name='image' label='Ambassador Image' width='250' height='250' crop='1' show_preview='1' type='image' order='4'/>
<cms:editable name='image_thumb' label='Ambassador Thumbnail' width='75' height='75' crop='1' show_preview='1' assoc_field='image' type='thumbnail' order='5' />
<cms:editable type='checkbox' opt_values='Active' label='Has the Ambassador Logged there first prospect?' desc='Please make sure they have logged a prospect or the ladder will break!' name='active' order='6' />
<cms:repeatable name='ambassador_tracker' label='Ambassador Tracker' order='7' >
<cms:editable type='text' label='Prospect Name' name='prospect' col_width='150' />
<cms:editable type='text' label='Account Manager' name='manager' col_width='150' />
<cms:editable type='text' label='Date Logged' name='date' col_width='150' />
<cms:editable name="progress" label="Progress" desc="Select one from these" opt_values='logged | contacted | meeting | presentation | quote' type='dropdown'/>
<cms:editable type='checkbox' opt_values='Logged | Quoted | Completed' label='Ladder' name='ladder' col_width='250' />
</cms:repeatable>
</cms:template>
<?php COUCH::invoke(); ?>
The output page code section
- Code: Select all
<cms:pages masterpage='ambassadors/index.php' custom_field='active=Active' orderby='ambassador_tracker=date'>
<cms:show_repeatable 'ambassador_tracker'>
<table class="table table-striped">
<tr>
<th>Prospect Name</th>
<th>Ambassador</th>
<th>Account Manager</th>
<th>Date Logged</th>
</tr>
<tr>
<td><cms:show prospect /></td>
<td><cms:show name /></td>
<td><cms:show manager /></td>
<td><cms:show date /></td>
</tr>
<tr>
<td colspan="4">
<img src="../img/progress/<cms:show progress />.png" alt=""/>
</td>
</tr>
</table>
</cms:show_repeatable>
</cms:pages>