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
<!--- | |
Place this function in your Site or Theme contentRenderer.cfc | |
Invoke by calling `$.dspDescendants()` | |
---> | |
<cffunction name="dspDescendants"> | |
<cfargument name="contentid" type="string" default="#$.content('contentid')#" /> | |
<cfset var local = {} /> | |
<cfset local.cBean = $.getBean('content').loadBy(contentid=arguments.contentid) /> | |
<cfsavecontent variable="local.str"> |
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
/* | |
There are two (2) image plugins available for CKEditor: | |
The "Image" plugin (https://ckeditor.com/cke4/addon/image), which is used by default; | |
and the "Enhanced Image" plugin (https://ckeditor.com/cke4/addon/image2), which offers the ability to caption images. | |
To enable the "Enhanced Image" plugin, follow these instructions: | |
1. Edit the file located under {ThemeName}/js/editor/config.js.cfm | |
(if the file doesn't exist, create it ... if the config.js.cfm.txt file exists, rename it to remove '.txt') |
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
/* | |
There's an elegant way to restrict character or word count in Mura CMS HTMLEditors. | |
1. Download the Word Count & Char Count Plugin: | |
https://ckeditor.com/cke4/addon/wordcount | |
2. Download the Notification plugin: | |
https://ckeditor.com/cke4/addon/notification | |
3. Unzip the the plugins and add the directories to the CKEditor plugins directory: |
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
<!--- Open Graph (http://ogp.me) ---> | |
<meta property="og:site_name" content="#esapiEncode('html_attr', m.siteConfig('site'))#" /> | |
<meta property="og.locale" content="#m.siteConfig('javalocale')#" /> | |
<meta property="og:title" content="#esapiEncode('html_attr', m.content('title'))#" /> | |
<meta property="og:type" content="website" /> | |
<meta property="og:url" content="#m.createHref(filename=m.content('filename'), complete=true)#" /> | |
<cfif Len(m.getURLForImage(fileid=m.content('fileid')))> | |
<meta property="og:image" content="#m.getURLForImage(fileid=m.content('fileid'), size='large', complete=true)#" /> | |
</cfif> | |
<cfif Len(m.content('metadesc'))> |
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 to an event handler | |
public any function onContentEditMessageRender(event, m) { | |
// reference to the event, if needed | |
var e = arguments.event; | |
// could also get a reference to event via Mura Scope | |
var mse = arguments.m.event(); | |
// this example merely shows how to render a simple message |
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
<!--- | |
NOTE: | |
In Mura 6, using '$.dspObject(object='component', objectid='Some Component')' in a layout template | |
would generate a pencil icon for content manager to edit the component from the front-end view of the site. | |
In Mura 7, we have migrated to using a layout manager for front-end edits. However, this old functionality no longer works. | |
So, here's a workaround to accomplish something very similar to the functionality in Mura 6. | |
1. Under your theme, create a directory labeled 'content_types' if it doesn't already exist | |
2. Under the 'content_types' directory, create another directory labeled 'component' |
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
<script> | |
Mura.DisplayObject.Form.reopen({ | |
onAfterRender: function() { | |
//this.context.targetEl is a pointer to the dom element that contains the rendered Mura form. | |
var container = Mura(this.context.targetEl); | |
console.log(this.context.targetEl); | |
} |
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
<!--- | |
Use to display mobile specific content (assumes you have an attribute called 'mobilebody') | |
---> | |
<cfset mybody = request.muramobilerequest == 1 | |
&& YesNoFormat(m.content('hasmobilebody')) | |
&& Len(m.content('mobilebody')) | |
? m.content('mobilebody') | |
: m.content('body') /> |
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
<!--- Force Image Resave for All Images ---> | |
<cfset application.serviceFactory.getBean('fileManager').rebuildImageCache(siteid='YOURSITEID')> | |
<!--- or to just reset a specific image size you can use ---> | |
<cfset application.serviceFactory.getBean('fileManager').rebuildImageCache(siteid='YOURSITEID' ,size='YOURSIZE')> |