Problems, need help? Have a tip or advice? Post it here.
10 posts Page 1 of 1
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.

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>
Hi,

Repeatable areas support drag-n-drop reordering of the rows - and that is the only order that is supported, I am afraid.
Dam! A little upsetting..
Is there something similar to repeatable regions that are not drag-n-drop??
I'm afraid, no :(
Tell me, are the rows so many that they cannot be ordered manually?
Ok! I had to change it a bit, and now I have used pages instead of repeatable areas..
but i have hit another snag, is there a way to add up /tall all checkboxs so I can add the result to a ladder?

Code: Select all
<?php require_once( 'admin/cms.php' ); ?>
<cms:template title='Leads' clonable='1'>
<cms:editable type='text' label='Prospect Name' name='prospect' order='1' />
<cms:editable name='name' label='Ambassador Name' desc='Please Select Ambassador' required='1' type='dropdown' opt_values="<cms:pages masterpage='ambassadors/index.php'><cms:show name /> |</cms:pages>" order='2' />
<cms:editable type='text' label='Account Manager' name='manager' order='3' />
<cms:editable type='text' label='Date Logged' name='date' order='4' />
<cms:editable name="progress" label="Progress" desc="Select one from these" opt_values='logged | contacted | meeting | presentation | quote' type='dropdown' order='5'/>
<cms:editable type='checkbox' opt_values='Logged | Quoted | Completed' label='Ladder' name='ladder' order='6' />
</cms:template>
<?php COUCH::invoke(); ?>


So each time Logged | Quoted | Completed is checked it is 1 point and then I tally up for a ladder?

Thanks Again for the help!
So each time Logged | Quoted | Completed is checked it is 1 point
Is it '1' if any of these values is checked? Or it'll depend on which of the three is checked?
'1' anytime one of these checked
No simple way then except looping through the selected options and adding them up.
What if I wanted them individually (tge other way) is there an easy way for that??
10 posts Page 1 of 1
cron