Page 1 of 1
Accelerated Mobile Pages (AMP) for CMSMS
Posted: Wed Sep 14, 2016 10:20 am
by chrisbt
Is anyone working on an AMP module/implementation for CMSMS?
Re: Accelerated Mobile Pages (AMP) for CMSMS
Posted: Thu Sep 22, 2016 12:40 pm
by chandra
There's no need for an additional module or implementation. It's only a question of right templating

.
Please make a look to this AMP introduction
http://www.sitepoint.com/an-introductio ... pages-amp/
In an easy way there's only a need to add
Code: Select all
<link rel="amphtml" href="__ANY URL_FOR_AMP__">
inside your template head.
But there's no need to create any content two times. You can easy AMP-ify the content

.
Wordpress solutions are using mostly on adding "?amp=1" at URL. You can use this for CMSMS similar like canonical URL.
Code: Select all
{if isset($canonical)}<link rel='amphtml' href='{$canonical|cat:'&=1'}' />{elseif isset($content_obj)}<link rel='amphtml' href='{$content_obj->GetURL()|cat:'&=1'}' />{/if}
You can read the added value with {$smarty.GET.amp}. Now it should be easy to AMP-ify every template.
For example
Code: Select all
{if $smarty.GET.amp != 1}
{cms_stylesheet}
{else}
{cms_stylesheet name='amp-style'}
{/if}
Re: Accelerated Mobile Pages (AMP) for CMSMS
Posted: Thu Sep 22, 2016 3:02 pm
by chrisbt
Thanks Chandra. Great reply. I'll look at using this approach as my first steps with AMP.
Cheers
Chris