Skip to content

Instantly share code, notes, and snippets.

@pauldenato
Last active March 30, 2016 16:01
Show Gist options
  • Save pauldenato/b83adfc56b417a5820ab890654d8053f to your computer and use it in GitHub Desktop.
Save pauldenato/b83adfc56b417a5820ab890654d8053f to your computer and use it in GitHub Desktop.
Remove/Edit FE toolbar in Mura
<!---
Custom JS for Front End Tool Bar. Additional checks are done in the edit files
Add this to Theme Contentrender
--->
<!--- Custom JS for Front End Tool Bar. Additional checks are done in the edit files --->
<cffunction name="dspGetMyCustomJS" returntype="any">
<cfsavecontent variable="returnMyCustomJS">
<cfif $.content('Title') EQ "News" and $.currentUser().getValue('S2') NEQ 1>
<cfset $.addToHTMLFootQueue("#$.siteConfig('themeAssetPath')#/display_objects/htmlfoot/top_toolbar_edits.cfm") />
<cfelse>
<!--- Add conditional code here if needed --->
</cfif>
</cfsavecontent>
<cfreturn returnMyCustomJS>
</cffunction>
<cfoutput>
<!--- Bootstrap JavaScript --->
<script src="#$.siteConfig('themeAssetPath')#/assets/bootstrap/js/bootstrap.min.js"></script>
<!--- CfStatic JS --->
<cf_CacheOMatic key="globalfooterjs">
#$.static().include('/js/theme/').renderIncludes('js')#
</cf_CacheOMatic>
<!---Get Toolbar Function--->
<!--- if your html_foot.cfm gile is different than the default bootstrap theme. Just copy the CF call below and paste it in yours. --->
#$.dspGetMyCustomJS()#
</body>
</html>
</cfoutput>
<!---Place this file and the top_toolbar_edits.js page in the "{theme}/display_objects/htmlfoot/" folder --->
<cfoutput>
<script src="#$.siteConfig('themeAssetPath')#/display_objects/htmlfoot/top_toolbar_edits.js"></script>
</cfoutput>
// JavaScript Document
jQuery(document).ready(function($){//Start JS DOc Ready
if($('.mura-toolbar').is(':visible'))
{
$("#adminEditPage").remove();
$("#adminDelete").remove();
$("#tools-changesets").remove();
setTimeout(function(){
$("#adminSiteManager").remove();
},700);
/* to turn the bar off completely use the code below.
$('.mura-toolbar').remove();
setTimeout(function(){
$('html').removeClass('mura-edit-mode');
},500);
*/
}
});//end JS Doc Ready
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment