Accelerated Mobile Pages (AMP) for CMSMS

Have a question or a suggestion about a 3rd party addon module or plugin?
Let us know here.
Locked
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 180
Joined: Sun Sep 05, 2010 6:11 am
Location: Sheffield, UK

Accelerated Mobile Pages (AMP) for CMSMS

Post by chrisbt »

Is anyone working on an AMP module/implementation for CMSMS?
chandra

Re: Accelerated Mobile Pages (AMP) for CMSMS

Post 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:'&amp=1'}' />{elseif isset($content_obj)}<link rel='amphtml' href='{$content_obj->GetURL()|cat:'&amp=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}
User avatar
chrisbt
Dev Team Member
Dev Team Member
Posts: 180
Joined: Sun Sep 05, 2010 6:11 am
Location: Sheffield, UK

Re: Accelerated Mobile Pages (AMP) for CMSMS

Post by chrisbt »

Thanks Chandra. Great reply. I'll look at using this approach as my first steps with AMP.

Cheers

Chris
Locked

Return to “Modules/Add-Ons”