This file contains 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
<!--- Vanilla js ---> | |
<script> | |
Mura(function(m) { | |
window.customFormValidation = function(theform) { | |
// example validation | |
if (theform.somefield.value === '') { | |
alert('Please enter a value in somefield'); | |
theform.somefield.focus(); | |
return false; | |
} |
This file contains 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 a Mura Event Handler | |
You could also use some logic such as | |
<cfif m.currentUser().isInGroup('some group')> then display something </cfif> | |
---> | |
<cffunction name="onFEToolbarExtensionRender"> | |
<cfset str = ""/> | |
<cfsavecontent variable="str"> | |
<cfoutput> | |
<ul id="tools-mycustom-tools"> |
This file contains 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
<cfparam name="form.issubmitted" default="false"/> | |
<cfoutput> | |
<form id="frm-temp" action="" method="post"> | |
<input type="text" name="testing" /> | |
#$.dspReCAPTCHA()# | |
<button type="submit" class="btn btn-primary">Submit</button> | |
<input type="hidden" name="issubmitted" value="true"/> | |
</form> |
This file contains 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
/* | |
Mura forms are loaded asynchronously. So, if you wish to run some scripts, you need | |
to use a special method to `reopen` the form, and add your scripts using | |
`Mura.DisplayObject.Form.reopen({})` | |
The most commonly needed examples are described below. | |
*/ |
This file contains 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.cache.connections["sessions"] = { | |
class: 'org.lucee.extension.io.cache.memcache.MemCacheRaw' | |
, bundleName: 'memcached.extension' | |
, bundleVersion: '3.0.2.29' | |
, storage: true | |
, custom: { | |
"socket_timeout":"30", | |
"initial_connections":"1", | |
"alive_check":"true", |
This file contains 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 example shows how to add custom scripts in the Admin area ... | |
// you could also use jQuery or whatever other method as well. | |
// Add this method to a Mura CMS SITE, THEME or PLUGIN eventHandler.cfc | |
public any function onAdminHTMLFootRender(m) { | |
var str = ''; | |
savecontent variable='str' { | |
WriteOutput(' | |
<script> | |
// Your script goes here. |
This file contains 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 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 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 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'))> |
OlderNewer