Skip to content
This repository has been archived by the owner on Feb 25, 2018. It is now read-only.

strip down or blow up the basic code

smooth-graphics edited this page Jul 13, 2011 · 1 revision

MODX-Boilerplate provides some sample-code snippets that are used in most of the websites build today. But surely there are some sites differing from that. Not every page really needs the Facebook Markup and super-media-queries or analytics. Some sites need more scripts or functions. So you have to modify the template for your purposes.

Remove FBML / Facebook

If you don't want to provide informations for Facebook, you can remove the whole FBML code from template. That means you have to remove the following code-snippets:

site_header.html: <html xmlns:og="http://opengraphprotocol.org/schema/" xmlns:fb="http://www.facebook.com/2008/fbml"> to <html>

remove completely: <!-- https://developers.facebook.com/docs/opengraph/ --> <meta property="og:title" content="[[*pagetitle]] - [[++site_name]]"/> <meta property="og:type" content=""/> <!-- https://developers.facebook.com/docs/opengraph/#types --> <meta property="og:url" content="[[++site_url]][[*id:isnot=++site_start:then=~[[*id]]]]"/> <meta property="og:image" content=""/> <meta property="og:site_name" content=""/> <meta property="fb:admins" content="USER_ID"/> <!-- set your facebook user / app-ID here --> <meta property="og:description" content="[[*introtext:empty=*content:strip_tags:strip:limit=200]]"/>

in site_footer.html: remove completely: `

`

in js/scripts.js: remove completely: //Code for Facebook XBML implementation. Cut off if not needed. Please paste your own App-ID at 'AppID' to get it working window.fbAsyncInit = function() { FB.init({appId: 'AppID', status: true, cookie: true, xfbml: true}); }; (function() { var e = document.createElement('script'); e.async = true; e.src = document.location.protocol + '//connect.facebook.net/en_US/all.js'; document.getElementById('fb-root').appendChild(e); }());

remove / change media-queries

If you don't need / want to use media-queries, remove the following lines from site_header.html: <!-- Load CSS files with media-queries ||| If your don't want to use media-queries, remove all m-qs and link to style.css --> <link rel="stylesheet" href="[[++site_url]]assets/templates/main/css/core.css" media="all"> <link rel="stylesheet" href="[[++site_url]]assets/templates/main/css/smartphone.css" media="only screen and (min-device-width : 320px) and (max-device-width : 480px)"> <link rel="stylesheet" href="[[++site_url]]assets/templates/main/css/ipad-portrait.css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px) and (orientation : portrait)"> <link rel="stylesheet" href="[[++site_url]]assets/templates/main/css/ipad.css" media="only screen and (min-device-width : 768px) and (max-device-width : 1024px)"> <link rel="stylesheet" href="[[++site_url]]assets/templates/main/css/iphone4.css" media="only screen and (-webkit-min-device-pixel-ratio : 1.5), only screen and (min-device-pixel-ratio : 1.5)"> and set the only css-file now: `

`

Remove Google Analytics / Replace it with another service

If you want to remove google analytics or replace it with another service, go to /js/scripts.js and remove: // Code for Google Analytics | Change UA-XXXXX-X to be your site's ID var _gaq=[['_setAccount','UA-XXXXX-X'],['_trackPageview'],['_trackPageLoadTime']]; (function(d,t){var g=d.createElement(t),s=d.getElementsByTagName(t)[0];g.async=1; g.src=('https:'==location.protocol?'//ssl':'//www')+'.google-analytics.com/ga.js'; s.parentNode.insertBefore(g,s)}(document,'script')); If you are using another service, you should place its code right there.