Forum for discussing general topics related to Couch.
6 posts Page 1 of 1
Hi

I found another issue today if someone can help please

I added a event that is on the 2nd March 2018 but noticed it don't show on the calendar until the current month shows so was wondering is it possible to display a list of upcoming events under the calendar or show the event for march on the calendar as it is

the url to the calendar is http://www.blackdogleicester.co.uk/events.php

The coding is below

Code: Select all
<?php require_once( 'cms/cms.php' ); ?>

<cms:template title='Events' clonable='1'>
    <cms:editable name='desc' label='Description' type='textarea' />
    <cms:editable name='location' label='Location' type='text' />

    <cms:editable name="start_time" label="Time From (24 Hrs)"
      opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
      type='dropdown'
    />

    <cms:editable name="end_time" label="Time Until (24 Hrs)"
      opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
      type='dropdown'
    />

    <cms:editable name='end_date'
        label='Event End Date (if multi-days event)'
        desc='Enter date in yyyy-mm-dd format e.g. 2010-12-31'
        type='text'
        validator='regex=/(?:19|20)\d\d-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|3[01])/'
        separator='#'
        validator_msg='regex=Incorrect date format'
    />

</cms:template>

<cms:if k_is_page >
        <!-- Page View -->
        <b>Event:</b> <cms:show k_page_title />
        <br>
        <b>Description:</b> <cms:show desc />
        <br>
        <b>Location:</b> <cms:show location />
        <br>
        <b>Date:</b> <cms:date k_page_date format='F j, Y' />
        <br><br>
        <a href="javascript:history.back()">Back to Calendar</a>
        <cms:if start_time!='Unspecified' >
            <b>From:</b> <cms:show start_time />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
        <cms:if "<cms:not_empty end_date />" >
            <b>End Date:</b> <cms:date end_date format='F j, Y' />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
        <cms:if end_time!='Unspecified' >
            <b>Till:</b> <cms:show end_time />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>

    <cms:else />
        <!-- List view -->
        <cms:calendar week_starts='1' date="<cms:gpc 'cal' />" masterpage=k_template_name show_future_entries='1' >
            <table class="calendar_big" align="center">
                <tr>
                    <th><a href="<cms:concat k_page_link '?cal=' k_prev_calendar_date />"> << </a></th>                   
                    <th colspan="5"><cms:date k_calendar_date format='F Y' /></th>
                    <th><a href="<cms:concat k_page_link '?cal=' k_next_calendar_date />"> >> </a></th>
                </tr>
                <tr>
                    <cms:repeat count='7'>
                    <td class="months_heading"><cms:zebra 'M' 'T' 'W' 'Th' 'F' 'S' 'Su'/></td>
                    </cms:repeat>
                </tr>

                <cms:weeks>
                    <tr>
                    <cms:days >
                        <cms:if k_timeline_position='present'>
                            <cms:set tdclass='today' />
                        <cms:else />
                            <cms:set tdclass='' />
                        </cms:if>

                        <cms:if k_position='current_month' >
                            <cms:if k_count_entries >
                                <td class='entries <cms:show tdclass />' align='center'>
                                    <a href="#"><cms:show k_day /></a>
                                    <ul>
                                    <cms:entries limit='2' skip_custom_fields='1'>
                                        <li>
                                            <a href="<cms:show k_page_link />"><cms:show k_page_title /></a>
                                        </li>
                                    </cms:entries>
                                    </ul>
                                </td>
                            <cms:else />
                                <td class='<cms:show tdclass />' ><cms:show k_day /></td>
                            </cms:if>
                        <cms:else />
                            <td class='other_month'><cms:show k_day /></td>
                        </cms:if>
                    </cms:days>
                    </tr>
                </cms:weeks>
            </table>
        </cms:calendar>
    </cms:if>

<?php COUCH::invoke(); ?>


UPDATE: Sorry sussed showing upcoming events, just need to know how to create recurring events if someone can help on that side of it please

Also how can I create recurring events, for example I need to create a event that happens every Friday and Saturday

Thank you in advance
how can I create recurring events, for example I need to create a event that happens every Friday and Saturday

Sorry, but no out-of-the-box solution currently available for recurring events.
OK no probs, for the time being I'll add the event to each Friday and Saturday on each week, hopefully recurring events can be added in the future by maybe some sort of checkbox that can check for every Friday/Saturday or where it had the days of the week and can check the days that the event is on each week

Just a quick question while I think of it, when the event data passes, does it not show on the calendar anymore or does it need to be deleted manually on the admin side?

Also where I have the list of the upcoming events under the large calendar, it currently shows the recent one added first, could it be changed to display the earliest date first, for example march 2nd first then the march 31st one last, see the url http://www.blackdogleicester.co.uk/even ... 01-03-2018 to see what I mean

also is it possible to limit the upcoming events by 3 or 5 so the list don't get too long?
when the event data passes, does it not show on the calendar anymore
It keeps showing.

could it be changed to display the earliest date first
Sorry, no.

also is it possible to limit the upcoming events by 3 or 5

Within the calendar? The <cms:entries> has the 'limit' parameter (your code is already using it) -
Code: Select all
<cms:entries limit='2' ..

Outside the calendar - any listing done through <cms:pages> has plenty of parameters to control what needs to be shown. Please see the docs.
I managed to get the limit working on the archives coding so it's showing only 3 and also I managed to have them in date order on the archives coding

it would be good if the events could be either deleted automatically if the date passes or be hidden if the date passes, is there no way to do the hidden method if the event date passes?

the coding I have now is below

Code: Select all
<?php require_once( 'cms/cms.php' ); ?>

<cms:template title='Events' clonable='1'>
    <cms:editable name='desc' label='Description' type='textarea' />
    <cms:editable name='location' label='Location' type='text' />

    <cms:editable name="start_time" label="Time From (24 Hrs)"
      opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
      type='dropdown'
    />

    <cms:editable name="end_time" label="Time Until (24 Hrs)"
      opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
      type='dropdown'
    />

    <cms:editable name='end_date'
        label='Event End Date (if multi-days event)'
        desc='Enter date in yyyy-mm-dd format e.g. 2010-12-31'
        type='text'
        validator='regex=/(?:19|20)\d\d-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|3[01])/'
        separator='#'
        validator_msg='regex=Incorrect date format'
    />

</cms:template>

<cms:if k_is_page >
        <!-- Page View -->
        <b>Event:</b> <cms:show k_page_title />
        <br>
        <b>Description:</b> <cms:show desc />
        <br>
        <b>Location:</b> <cms:show location />
        <br>
        <b>Date:</b> <cms:date k_page_date format='F j, Y' />
        <br><br>
        <a href="javascript:history.back()">Back to Calendar</a>
        <cms:if start_time!='Unspecified' >
            <b>From:</b> <cms:show start_time />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
        <cms:if "<cms:not_empty end_date />" >
            <b>End Date:</b> <cms:date end_date format='F j, Y' />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
        <cms:if end_time!='Unspecified' >
            <b>Till:</b> <cms:show end_time />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
       
    <cms:else />
        <!-- List view -->
        <cms:set my_cal="<cms:date "<cms:gpc 'cal' />" format='Y-m-d' />" />
        <cms:calendar week_starts='1' date=my_cal masterpage=k_template_name show_future_entries='1' >
       
            <table class="calendar_big" align="center">
                <tr>
                    <cms:set my_prev_calendar_date = "<cms:date k_prev_calendar_date format='d-m-Y' />" />
                    <th><a href="<cms:concat k_page_link '?cal=' my_prev_calendar_date />"> << </a></th>                   
                    <th colspan="5"><cms:date k_calendar_date format='F Y' /></th>
                    <cms:set my_next_calendar_date = "<cms:date k_next_calendar_date format='d-m-Y' />" />
                    <th><a href="<cms:concat k_page_link '?cal=' my_next_calendar_date />"> >> </a></th>
                </tr>
                <tr>
                    <cms:repeat count='7'>
                    <td class="months_heading"><cms:zebra 'M' 'T' 'W' 'Th' 'F' 'S' 'Su'/></td>
                    </cms:repeat>
                </tr>

                <cms:weeks>
                    <tr>
                    <cms:days >
                        <cms:if k_timeline_position='present'>
                            <cms:set tdclass='today' />
                        <cms:else />
                            <cms:set tdclass='' />
                        </cms:if>

                        <cms:if k_position='current_month' >
                            <cms:if k_count_entries >
                                <td class='entries <cms:show tdclass />' align='center'>
                                    <a href="#"><cms:show k_day /></a>
                                    <ul>
                                    <cms:entries limit='2' skip_custom_fields='1'>
                                        <li>
                                            <a href="<cms:show k_page_link />"><cms:show k_page_title /></a>
                                        </li>
                                    </cms:entries>
                                    </ul>
                                </td>
                            <cms:else />
                                <td class='<cms:show tdclass />' ><cms:show k_day /></td>
                            </cms:if>
                        <cms:else />
                            <td class='other_month'><cms:show k_day /></td>
                        </cms:if>
                    </cms:days>
                    </tr>
                </cms:weeks>
            </table>
           
            <br>
           
            <h2>Upcoming Events</h2>
            <cms:archives limit='3' order='asc' masterpage=k_template_name type='daily' show_future_entries='1'>
            <cms:pages master=k_template_name start_on=k_archive_date stop_before=k_next_archive_date show_future_entries='1'>           
                  <div class="panel-body">
                  <cms:show k_page_title /><br>
                     <b>Description:</b> <cms:show desc /><br>
                     <b>Location:</b> <cms:show location /><br>
                     <b>Date:</b> <cms:date k_page_date format='F j Y' /><br>
                     <cms:if start_time!='Unspecified' >
                        <b>From:</b> <cms:show start_time /><br>
                     </cms:if>
                     <cms:if "<cms:not_empty end_date />" >
                        <b>End Date:</b> <cms:date end_date format='F j Y' /><br>
                     </cms:if>
                     <cms:if end_time!='Unspecified' >
                        <b>Till:</b> <cms:show end_time /><br>
                     </cms:if>
                  </div>
            </cms:pages>
         </cms:archives>
           
        </cms:calendar>
    </cms:if>

<?php COUCH::invoke(); ?>
I managed to have the upcoming events list not show events that are in the past but it still remains on the calendar which is ok as guess visitors can look at previous events but thin main thing it does not show on the upcoming events list, the code I have is now below

Code: Select all
<?php require_once( 'cms/cms.php' ); ?>

<cms:template title='Events' clonable='1'>
    <cms:editable name='desc' label='Description' type='textarea' />
    <cms:editable name='location' label='Location' type='text' />

    <cms:editable name="start_time" label="Time From (24 Hrs)"
      opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
      type='dropdown'
    />

    <cms:editable name="end_time" label="Time Until (24 Hrs)"
      opt_values=' Unspecified |
                  00:00 | 00:30 | 01:00 | 01:30 | 02:00 | 02:30 | 03:00 | 03:30 |
                  04:00 | 04:30 | 05:00 | 05:30 | 06:00 | 06:30 | 07:00 | 07:30 |
                  08:00 | 08:30 | 09:00 | 09:30 | 10:00 | 10:30 | 11:00 | 11:30 |
                  12:00 | 12:30 | 13:00 | 13:30 | 14:00 | 14:30 | 15:00 | 15:30 |
                  16:00 | 16:30 | 17:00 | 17:30 | 18:00 | 18:30 | 19:00 | 19:30 |
                  20:00 | 20:30 | 21:00 | 21:30 | 22:00 | 22:30 | 23:00 | 23:30 |'
      type='dropdown'
    />

    <cms:editable name='end_date'
        label='Event End Date (if multi-days event)'
        desc='Enter date in yyyy-mm-dd format e.g. 2010-12-31'
        type='text'
        validator='regex=/(?:19|20)\d\d-(?:0[1-9]|1[012])-(?:0[1-9]|[12][0-9]|3[01])/'
        separator='#'
        validator_msg='regex=Incorrect date format'
    />

</cms:template>

<cms:if k_is_page >
        <!-- Page View -->
        <b>Event:</b> <cms:show k_page_title />
        <br>
        <b>Description:</b> <cms:show desc />
        <br>
        <b>Location:</b> <cms:show location />
        <br>
        <b>Date:</b> <cms:date k_page_date format='F j, Y' />
        <br><br>
        <a href="javascript:history.back()">Back to Calendar</a>
        <cms:if start_time!='Unspecified' >
            <b>From:</b> <cms:show start_time />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
        <cms:if "<cms:not_empty end_date />" >
            <b>End Date:</b> <cms:date end_date format='F j, Y' />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
        <cms:if end_time!='Unspecified' >
            <b>Till:</b> <cms:show end_time />
            <br><br>
            <a href="javascript:history.back()">Back to Calendar</a>
        </cms:if>
       
    <cms:else />
        <!-- List view -->
        <cms:set my_cal="<cms:date "<cms:gpc 'cal' />" format='Y-m-d' />" />
        <cms:calendar week_starts='1' date=my_cal masterpage=k_template_name show_future_entries='1' >
       
            <table class="calendar_big" align="center">
                <tr>
                    <cms:set my_prev_calendar_date = "<cms:date k_prev_calendar_date format='d-m-Y' />" />
                    <th><a href="<cms:concat k_page_link '?cal=' my_prev_calendar_date />"> << </a></th>                   
                    <th colspan="5"><cms:date k_calendar_date format='F Y' /></th>
                    <cms:set my_next_calendar_date = "<cms:date k_next_calendar_date format='d-m-Y' />" />
                    <th><a href="<cms:concat k_page_link '?cal=' my_next_calendar_date />"> >> </a></th>
                </tr>
                <tr>
                    <cms:repeat count='7'>
                    <td class="months_heading"><cms:zebra 'M' 'T' 'W' 'Th' 'F' 'S' 'Su'/></td>
                    </cms:repeat>
                </tr>

                <cms:weeks>
                    <tr>
                    <cms:days >
                        <cms:if k_timeline_position='present'>
                            <cms:set tdclass='today' />
                        <cms:else />
                            <cms:set tdclass='' />
                        </cms:if>

                        <cms:if k_position='current_month' >
                            <cms:if k_count_entries >
                                <td class='entries <cms:show tdclass />' align='center'>
                                    <a href="#"><cms:show k_day /></a>
                                    <ul>
                                    <cms:entries limit='2' skip_custom_fields='1'>
                                        <li>
                                            <a href="<cms:show k_page_link />"><cms:show k_page_title /></a>
                                        </li>
                                    </cms:entries>
                                    </ul>
                                </td>
                            <cms:else />
                                <td class='<cms:show tdclass />' ><cms:show k_day /></td>
                            </cms:if>
                        <cms:else />
                            <td class='other_month'><cms:show k_day /></td>
                        </cms:if>
                    </cms:days>
                    </tr>
                </cms:weeks>
            </table>
           
            <br>
           
            <!-- set a variable named 'today' with current date in Y-m-d format -->
            <cms:set today="<cms:date format='Y-m-d' />" />
           
            <h2>Upcoming Events</h2>
            <cms:archives limit='3' order='asc' masterpage=k_template_name type='daily' start_on=today show_future_entries='1' >           
            <cms:pages master=k_template_name start_on=k_archive_date stop_before=k_next_archive_date show_future_entries='1'>                       
                  <div class="panel-body">
                  <cms:show k_page_title /><br>
                     <b>Description:</b> <cms:show desc /><br>
                     <b>Location:</b> <cms:show location /><br>
                     <b>Date:</b> <cms:date k_page_date format='F j Y' /><br>
                     <cms:if start_time!='Unspecified' >
                        <b>From:</b> <cms:show start_time /><br>
                     </cms:if>
                     <cms:if "<cms:not_empty end_date />" >
                        <b>End Date:</b> <cms:date end_date format='F j Y' /><br>
                     </cms:if>
                     <cms:if end_time!='Unspecified' >
                        <b>Till:</b> <cms:show end_time /><br>
                     </cms:if>
                  </div>
            </cms:pages>
         </cms:archives>
           
        </cms:calendar>
    </cms:if>

<?php COUCH::invoke(); ?>
6 posts Page 1 of 1
cron