Skip to content

Instantly share code, notes, and snippets.

Show Gist options
  • Save mattlevine/aac63a5307930c7269c9d65f4ce3c4b9 to your computer and use it in GitHub Desktop.
Save mattlevine/aac63a5307930c7269c9d65f4ce3c4b9 to your computer and use it in GitHub Desktop.
Mura CMS : Example of how to group Mura CMS calendar events together. Another example can be found at https://gist.github.com/stevewithington/18a6ef38e7234f1e1fc3
<!--- See https://gist.github.com/stevewithington/18a6ef38e7234f1e1fc3 for a better example! --->
<cfscript>
it = $.getBean('feed').loadBy(name='Your Feed Name').getIterator(
from=Now()
, to=DateAdd('m', 2, Now())
);
rs = $.getCalendarUtility().filterCalendarItems(it.getQuery(),0);
</cfscript>
<ul>
<cfoutput query="rs" group="contentid">
<li>
<a href="#$.createHREF(filename=filename)#">#title#</a>: #LSDateFormat(displaystart)#
<cfquery dbtype="query" name="subRS">
select *
from rs
where rs.contentid = <cfqueryparam value="#contentid#" />
</cfquery>
<cfif subRS.recordcount gt 1>
<cfset enddate = ListLast(ValueList(subRS.displaystop)) />
<cfif IsValid('date', enddate)>
-#LSDateFormat(enddate)#
</cfif>
</cfif>
</li>
</cfoutput>
</ul>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment