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> | |
public any function onAfterUserSave($) { | |
// reference to new user bean | |
var user = arguments.$.event('userBean'); | |
// reference to old user bean | |
//var oldUserBean = arguments.$.getBean('user').loadBy(userid=user.getUserID()); | |
// reference to content item that will be the parent of the 'User' page | |
var parentbean = $.getBean('content').loadBy(title='Reps'); |
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
<!--- | |
https://gist.github.com/stevewithington/18a6ef38e7234f1e1fc3 | |
1) Drop this in your Site or Theme contentRenderer.cfc | |
2) To use, drop the following line of code in your layout template, and modify as you wish: | |
#$.getUpcomingEventsByFeedname(feedname='Your Feed Name', maxMonths=2, groupDailyEvents=true)# | |
---> | |
<cffunction name="getUpcomingEventsByFeedname"> | |
<cfargument name="feedName" type="string" required="true" /> | |
<cfargument name="maxMonths" type="numeric" default="3" /> | |
<cfargument name="groupDailyEvents" default="true" /> |
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> | |
// recordset | |
rsCustomSizes = $.siteConfig().getCustomImageSizeQuery(); | |
// iterator | |
itCustomImageSizes = $.siteConfig().getCustomImageSizeIterator(); | |
// OR, drop this in your contentRenderer.cfc, and access via $.getImageSizeQuery() | |
public any function getImageSizeQuery() { | |
var rs = variables.$.siteConfig().getCustomImageSizeQuery(); |
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
<!--- | |
// For GMAIL accounts: | |
server=smtp.gmail.com | |
port=465 | |
useSSL=yes | |
---> | |
<cfparam name="form.message" default="Test" /> |
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> | |
// This will NOT work unless you have 'allowlocalfiles=true' in /config/settings.ini.cfm | |
// example path to files | |
try { | |
filepath = ExpandPath('./files'); | |
} catch(any e) { | |
filepath = ExpandPath('./'); | |
} |
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> | |
// Will NOT work unless you have 'allowlocalfiles=true' in /config/settings.ini.cfm | |
try { | |
filepath = ExpandPath('temp.pdf'); | |
} catch(any e) { | |
filepath = ''; | |
} | |
param name='form.thefile' default=filepath; |
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 itKids = $.content().getKidsIterator() /> | |
<cfif itKids.hasNext()> | |
<ul> | |
<cfloop condition="itKids.hasNext()"> | |
<li> | |
<cfscript> | |
item = itKids.next(); | |
fileid = item.getValue('fileid'); | |
if ( item.hasImage() ) { |
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> | |
// This will NOT work unless you have 'allowlocalfiles=true' in /config/settings.ini.cfm | |
// read image info on local file for default value | |
try { | |
ir = ImageRead('steve-withington.jpg'); | |
img = ir.source; | |
} catch(any e) { | |
img = ''; | |
} |
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"> |