A better way to link to code on Github:
- Highlight the code that you want to link to
- Then, tap the "y" key to jump to the last commit found for that region
- Copy the URL & paste wherever you want
| <cfscript> | |
| // Let's say you want to pass in some arguments to the file located under /includes/displayObjects.cfc. For example: | |
| public any function dspMuraFW1App3($, someArg='', anotherArg='Something') { | |
| param name='request.context' default='#{}#'; | |
| StructAppend(request.context.myArgs, arguments); | |
| // now they'll be available in your subapps as rc.myArgs.argName | |
| return getApplication().doAction('app3:main.default'); | |
| } | |
| </cfscript> |
| <cfscript> | |
| public any function onSiteRequestStart($) { | |
| param name='session.customsession' default=getDefaultCustomSessionSettings(); | |
| // you could use whatever trigger you want to set your session var(s), but i'm just using something simple for this example | |
| if ( IsDefined('url.somekey') ) { | |
| lock scope='session' type='exclusive' timeout=10 { | |
| session.customsession = { | |
| somekey = url.somekey | |
| , dateinitalized = Now() |
A better way to link to code on Github:
| <cfscript> | |
| public any function getMyEvents(calendarid=variables.$.content('contentid'), months=6) { | |
| var local = {}; | |
| local.util = variables.$.getCalendarUtility(); | |
| local.rsItems = local.util.getCalendarItems( | |
| calendarid=arguments.calendarid | |
| , start=Now() | |
| , end=DateAdd('m', arguments.months, Now()) | |
| ); | |
| return rsItems; |
| <!--- | |
| 1) Drop this in your Site or Theme contentRenderer.cfc | |
| 2) Call this on a template: #$.dspColumnizedChildren(columns=3, imageSize='medium')# | |
| 3) Or within the editor via Mura tags [m]$.dspColumnizedChildren(columns=3, imageSize='medium')[/m] | |
| ---> | |
| <cffunction access="public" output="false" returntype="any" name="dspColumnizedChildren"> | |
| <cfargument name="columns" default="3" type="numeric" /> | |
| <cfargument name="imageSize" default="medium" type="string" /> | |
| <cfscript> | |
| var str = ''; |
| <!--- Drop this in your Site or Theme Event Handler ---> | |
| <cffunction name="onAdminHTMLFootRender"> | |
| <cfargument name="event"> | |
| <cfargument name="$"> | |
| <cfset var scripts = ''> | |
| <cfif StructKeyExists(url, 'muraAction') and url.muraAction eq 'cArch.edit'> | |
| <cfsavecontent variable="scripts"> | |
| <script> | |
| jQuery(document).ready(function($){ | |
| var newSummary = 'My Summary ' + '<i class="icon-question-sign"></i>'; |
| <cfscript> | |
| // drop this into your SITE or THEME eventHandler.cfc to trigger a 404 on missing .cfm files | |
| public any function onSiteRequestStart($) { | |
| request.uri = GetPageContext().GetRequest().GetRequestURI(); | |
| request.template = Right(request.uri, 1) != '/' ? ListLast(request.uri, '/') : ''; | |
| if ( Len(request.template) && !FileExists(ExpandPath(request.template)) ) { | |
| request.currentfilenameadjusted = request.template; | |
| } | |
| } | |
| </cfscript> |
| <cfscript> | |
| // 1) Drop these methods into your Theme or Site contentRenderer.cfc | |
| // 2) Create a component called 'Upcoming Events' and using the Mura tag, call [m]$.getUpcomingEvents()[/m] | |
| // 3) You can also control how many months of data you wish to retrieve and the maxItems to return | |
| // For example: [m]$.getUpcomingEvents(months=3, maxItems=3)[/m] | |
| public any function getUpcomingEvents( | |
| string calendarid='#variables.$.content('contentid')#' | |
| , numeric months=1 | |
| , numeric maxitems=6 | |
| , string categoryid='#variables.$.event('categoryid')#' |
| <cfscript> | |
| public any function isoDateTimeFormat(date timestamp='#Now()#') { | |
| var dt = DateConvert('local2utc', arguments.timestamp); | |
| return DateFormat(dt, 'yyyy-mm-dd') & 'T' & TimeFormat(dt, 'HH:mm:ss.000') & 'Z'; | |
| } | |
| </cfscript> |