Forked from stevewithington/muraGroupCalendarEvents.cfm
Created
April 27, 2018 19:16
-
-
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
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<!--- 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