Skip to content
MuraCon - Mura AMP'ed Up presentation
Branch: master
Clone or download

Latest commit

Fetching latest commit…
Cannot retrieve the latest commit at this time.


Type Name Latest commit message Commit time
Failed to load latest commit information.

Mura Amp'd Up

This is just an example of how to start making your site AMP Compatible.

For this to work:

  1. You must be on Mura 7.1.184 or greater

  2. Add this to your theme eventhandler.cfc in the onRenderStart();

<!--- Allows AMP to work --->
<cfif $.event('amp') eq 1>
	<cfset request.returnFormat='AMP'>
  1. Place the /amp_inc folder in the theme/templates

  2. In the html_head.cfm file place the following just below the feeds.

Replace blog and news with the sections of the site you wish to expose to AMP

<!--- MURA AMP --->
<cfif len($.content().getFileName())>
	<cfif listFindNoCase('Blog,News', $.content().getParent().getTitle()) >
		<link rel="amphtml" href="#$.content().getURL(complete='true')#?amp=1" />
  1. In the navbar.cfm wrap the standard cfml in the folowing <cfif>
<cfif request.returnFormat NEQ 'AMP'>
	<!--- Standard Mura Navbar Code --->
	<!--- Include AMP Header --->
	<div class="logo">
		<a href="#$.createHREF(filename=$.content('filename'))#">
			<amp-img src="#$.siteConfig('themeAssetPath')#/images/{-- your logo --}" height="50" width="150" alt="Mura AMP'd Up"></a>
  1. Lastly wrap the code in the templates you are using for the sections identified above in the folowing <cfif>
<cfif request.returnFormat NEQ 'AMP'>
	<!--- Your template code.  In my case the two_column_SR and the three_column --->
	<cfinclude template = "amp_inc/page_amp.cfm">
  1. Once complete you should be able to navigate to a designated amp page with ?amp=1 appended to the url and start validaiting your markup.

note for amp-youtube to work you'll need to create a Page/YouTube subtype and put the /page_youtube/ folder into the content_types directory.


You can’t perform that action at this time.