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
<cfscript> | |
// Add this to an eventHandler.cfc | |
public any function onAdminHTMLFootRender($) { | |
var str = ''; | |
// this will add a link to the bottom of the 'Modules' button in the back end admin area | |
savecontent variable='str' { | |
WriteOutput('<script> | |
jQuery(document).ready(function($){ | |
$("##navSecondary").append(''<li><a href="/some-url/"><i class="icon-cog fa-cog"></i> Some URL</a></li>''); | |
}); |
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> | |
// 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
component { | |
/** | |
* MURA FORM: `CUSTOM OBJECT` Options Example | |
* | |
* Notes: | |
* + On the form, select `Custom Object` and enter the dotted notation path to where this file resides under `/sites/{SiteID}` | |
* - For example, if the file is located under `/sites/default/remote/muraFormCustomObjectOptions.cfc` | |
* - Enter: `remote.muraFormCustomOptions` | |
* - Keep in mind, Mura will be looking for the `getData()` method! See below. | |
* + How to use a REMOTE SOURCE for options: <https://gist.github.com/stevewithington/115b5ac681fe35d42505b1cdedad1593> |
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
<!--- | |
Add this to html_head.cfm | |
<script type="text/javascript" src="#$.siteConfig('assetPath')#/js/swfobject/swfobject.js"></script> | |
Example Usage: | |
#$.dspSWF(swf='#$.siteConfig('themeAssetPath')#/assets/yourfile.swf', width=680, height=100, objectID='your-file', wrapperID='your-file-wrapper')# | |
---> | |
<cffunction name="dspSWF" output="false" returntype="any"> | |
<cfargument name="swf" default="" /> | |
<cfargument name="width" default="100" /> |
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
<!--- drop these methods into your Site or Theme contentRenderer.cfm ---> | |
<cfscript> | |
// props: http://cflib.org/udf/RGBtoHex | |
public any function RGBtoHex(r,g,b){ | |
var hexColor = ''; | |
var hexPart = ''; | |
var i = 0; | |
for (i=1; i <= 3; i++){ | |
hexPart = FormatBaseN(arguments[i],16); |
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
<!--- if using CFStatic ---> | |
<cf_CacheOMatic key="isotopeCSS"> | |
#$.static() | |
.include('/css/isotope/') | |
.renderIncludes('css')# | |
</cf_CacheOMatic> | |
<!--- Static CSS Include ---> | |
<!--- <link rel="stylesheet" href="#$.siteConfig('themeAssetPath')#/css/isotope/isotope.css"> ---> |
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> | |
// USER feed bean | |
userFeed = $.getBean('userFeed'); | |
// if user(s) belong to a different site, specify desired siteid | |
// userFeed.setSiteID('someSiteID'); | |
// if you know the groupid, you can filter that | |
// userFeed.setGroupID('someGroupID', false); |