I have this code which is limiting the results to 3 but I assumed if the start count is 0 then the first would be 0 and second 1 and third 2 which would mean the k_count should be 3? But if I set it to 3 then it shows 2 only. So I assume if I set start count at 0 it starts counting at 1?:
I need to display only 3 entree's
I need to sort them by date, the date is a regular text field where they type October 15th, 2016
This is the events.php code in the top of the page:
Is there a better way to do this? Using repeatable lets them "sort" the rows as they want them to appear. However I am just looking to show them from newest to oldest dates and only the first 3 results following those rules.
Thanks again!
- Code: Select all
<div class="news">
<cms:pages masterpage='events.php' startcount='0'>
<cms:show_repeatable 'events'>
<cms:if k_count lt '4'>
<div class="col-md-4 new-more">
<div class="now-more1">
<div class="event">
<h4><cms:show date /></h4>
<label></label>
<h6><a href="single.html"><cms:show title /></a></h6>
<p><cms:show description /></p>
<a href="single.html" class="hvr-rectangle-out ">Learn More</a>
</div>
</div>
</div>
</cms:if>
</cms:show_repeatable>
</cms:pages>
<div class="clearfix"> </div>
</div>
I need to display only 3 entree's
I need to sort them by date, the date is a regular text field where they type October 15th, 2016
This is the events.php code in the top of the page:
- Code: Select all
<?php require_once('manage/cms.php'); include('assets/config.php'); ?>
<cms:template title='Events' order='6' >
<cms:repeatable name='events' >
<cms:editable type='image' name='image' label='Photo' show_preview='1' preview_width='150' input_width='200' col_width='300' />
<cms:editable type='text' name='title' label='Title' desc='Enter a title' />
<cms:editable type='text' name='date' label='Date' desc='Enter a date' />
<cms:editable type='textarea' name='description' label='Description' desc='Enter a description' />
</cms:repeatable>
</cms:template>
<?php COUCH::invoke(); ?>
Is there a better way to do this? Using repeatable lets them "sort" the rows as they want them to appear. However I am just looking to show them from newest to oldest dates and only the first 3 results following those rules.
Thanks again!