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
<!--- | |
1) Drop this method in your /config/cfapplication.cfm and modify it as you wish. | |
For example, maybe you only want to allow front end tools if editing the site behind your firewall | |
---> | |
<cfscript> | |
public boolean function getEnableFrontEndTools() { | |
return getPageContext().getRequest().getServerName() == 'someURLAccessibleOnlyBehindYourFirewall.com'; | |
} | |
</cfscript> |
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
<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> |
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
<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')#' |
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
<cfset application.serviceFactory.getBean('fileManager').cleanFileCache('[siteid]') /> |
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
<!-- | |
1) Drop this in your theme /{SiteID}/includes/themes/{Theme}/config.xml.cfm | |
--> | |
<theme> | |
<extensions> | |
<extension type="Folder" subType="FAQ" availableSubTypes="Page/Question" iconClass="icon-question-sign"> | |
</extension> | |
<extension type="Page" subType="Question" iconClass="icon-question" hasSummary="0" hasBody="0" hasAssocFile="0"> | |
</extension> |
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
<cfscript> | |
// Save this file to a path such as /{SiteID}/includes/themes/{ThemeName}/remote/ajaxData.cfc | |
component { | |
remote string function getData(siteid='default', contentid='00000000000000000000000000000000001') returnformat='plain' { | |
var str = ''; | |
var $ = get$(arguments.siteid, arguments.contentid); | |
savecontent variable='str' { | |
WriteOutput("<h1>Hello from ajaxData.cfc</h1> |
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
<cfscript> | |
// drop this in your Site or Theme eventHandler.cfc | |
public any function onRenderStart($) { | |
if ( $.event('showMeta') != 2 && $.content().getParent().getValue('type') != 'Folder' ) { | |
$.event('showMeta', 1); | |
} | |
} | |
</cfscript> |
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
<cfscript> | |
// Drop this in your Site or Theme eventHandler.cfc | |
public any function onBeforeFormSubmitSave($) { | |
// reference to the formBean | |
var formBean = arguments.$.event('formDataBean'); | |
// example on how to create some errors | |
var error = ''; | |
var errors = {}; |
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
<cfscript> | |
// place this in your Site or Theme eventHandler.cfc, then reload your application! | |
public any function onApplicationLoad($) { | |
arguments.$.getBean('contentUtility').findAndReplace( | |
find='http://olddomain.com' | |
, replace='http://newdomain.com' | |
, siteid=arguments.$.event('siteid') | |
); | |
} | |
</cfscript> |
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
<cfoutput> | |
<div> | |
<form action="#$.content('url')#?keywords=#$.event('keywords')#"> | |
<dl> | |
<dt>Keywords</dt> | |
<dd><input type="text" name="keywords" value="#HTMLEditFormat($.event('keywords'))#" /></dd> | |
<dd><input type="submit" value="Search" /></dd> | |
</dl> |