I'm setting up an event calendar per the documentation provided online, but the small view is not linking correctly to a page view for events for the day:
Here's the code for the small calendar implementation from the index page:
And here's the full events.php code:
Here's the code for the small calendar implementation from the index page:
- Code: Select all
<div class="row">
<div class="col-md-4">
<div class="thumbnail text-center table-responsive">
<cms:calendar masterpage='events.php'>
<table id="calendarThumb" class="calendar_small table-bordered">
<tr>
<th colspan="7"><cms:date k_calendar_date format='F Y' /></th>
</tr>
<tr>
<cms:repeat count='7'>
<td class="months_heading"><cms:zebra 'Su' 'M' 'T' 'W' 'Th' 'F' 'S'/></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 />' >
<a href="<cms:link masterpage='events.php' year=k_year month=k_month day=k_day />"><cms:show k_day /></a>
</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>
<a href="events.php" class="btn btn-primary" role="button">See All Library Events</a>
</div>
</div>
And here's the full events.php code:
- Code: Select all
<?php require_once( 'couch/cms.php' ); ?>
<cms:template title='Events' clonable='1'>
<cms:editable name='desc' label='Description' type='textarea' required='1' />
<cms:editable name='location' label='Location' desc='Select the hosting branch'
opt_values=' Library1 | Library2 | etc '
type='dropdown' />
<cms:editable name="start_time" label="Time From"
opt_values=' Unspecified |
12:00am | 12:30am | 01:00am | 01:30am | 02:00am | 02:30am | 03:00am | 03:30am |
04:00am | 04:30am | 05:00am | 05:30am | 06:00am | 06:30am | 07:00am | 07:30am |
08:00am | 08:30am | 09:00am | 09:30am | 10:00am | 10:30am | 11:00am | 11:30am |
12:00pm | 12:30pm | 01:00pm | 01:30pm | 02:00pm | 02:30pm | 03:00pm | 03:30pm |
04:00pm | 04:30pm | 05:00pm | 05:30pm | 06:00pm | 06:30pm | 07:00pm | 07:30pm |
08:00pm | 08:30pm | 09:00pm | 09:30pm | 10:00pm | 10:30pm | 11:00pm | 11:30pm |'
type='dropdown'
/>
<cms:editable name="end_time" label="Time Until"
opt_values=' Unspecified |
12:00am | 12:30am | 01:00am | 01:30am | 02:00am | 02:30am | 03:00am | 03:30am |
04:00am | 04:30am | 05:00am | 05:30am | 06:00am | 06:30am | 07:00am | 07:30am |
08:00am | 08:30am | 09:00am | 09:30am | 10:00am | 10:30am | 11:00am | 11:30am |
12:00pm | 12:30pm | 01:00pm | 01:30pm | 02:00pm | 02:30pm | 03:00pm | 03:30pm |
04:00pm | 04:30pm | 05:00pm | 05:30pm | 06:00pm | 06:30pm | 07:00pm | 07:30pm |
08:00pm | 08:30pm | 09:00pm | 09:30pm | 10:00pm | 10:30pm | 11:00pm | 11:30pm |'
type='dropdown'
/>
<cms:editable name='start_date' label='Event Date'
desc='Enter date in yyyy-mm-dd formate e.g. 2010-12-31'
type='text'
validator='MyEvent::start_date'
separator='#'
validator_msg='MyEvent::start_date=Incorrect date format'
required='1'
/>
<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>
<HTML>
<HEAD>
<cms:embed 'header.html' />
</HEAD>
<BODY>
<div class="container-fluid">
<cms:embed 'menu.html' />
<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>
<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>
<cms:else />
<!-- List view -->
<cms:calendar date="<cms:gpc 'cal' />" masterpage=k_template_name show_future_entries='1' >
<table class="calendar_big table-bordered">
<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 'Su' 'M' 'T' 'W' 'Th' 'F' 'S'/></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>
</div>
</BODY>
</HTML>
<?php COUCH::invoke(); ?>