View previous topic :: View next topic |
Author |
Message |
gtraxx Smarty Regular
Joined: 08 Jan 2008 Posts: 56
|
Posted: Fri Mar 24, 2017 9:52 am Post subject: Google amp project |
|
|
Hi, is it possible to create a google AMP project with smarty ?
How to generate "AMP" pages with smarty ? _________________ * Creator of Magix CMS
* Creator of Magix cjQuery
* Co-maintainer jQuery UI Bootstrap |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Mar 24, 2017 9:56 am Post subject: |
|
|
Yes, it is possible. Just like any other content. Not only webpages. |
|
Back to top |
|
gtraxx Smarty Regular
Joined: 08 Jan 2008 Posts: 56
|
Posted: Fri Mar 24, 2017 9:59 am Post subject: |
|
|
Thanks, Would you have a simple example of creating an AMP page? _________________ * Creator of Magix CMS
* Creator of Magix cjQuery
* Co-maintainer jQuery UI Bootstrap |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Fri Mar 24, 2017 10:07 am Post subject: |
|
|
There's entire documentation of examples.
If you explain, what you have difficulties with, it will be easier to help you. |
|
Back to top |
|
adn Smarty Regular
Joined: 31 May 2011 Posts: 91
|
Posted: Wed Mar 29, 2017 2:10 pm Post subject: |
|
|
No specific things
Personnaly I just created templates for amp pages. My amp pages have a param & and when I detect it I use others templates. Easy
_________________ http://www.letsGarden.info |
|
Back to top |
|
anything7pob Smarty Rookie
Joined: 26 Mar 2017 Posts: 26
|
Posted: Tue Apr 25, 2017 7:51 pm Post subject: |
|
|
I am getting a 500 error when I add
Code: | <style amp-boilerplate>body{-webkit-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-moz-animation:-amp-start 8s steps(1,end) 0s 1 normal both;-ms-animation:-amp-start 8s steps(1,end) 0s 1 normal both;animation:-amp-start 8s steps(1,end) 0s 1 normal both}@-webkit-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-moz-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-ms-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@-o-keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}@keyframes -amp-start{from{visibility:hidden}to{visibility:visible}}</style><noscript><style amp-boilerplate>body{-webkit-animation:none;-moz-animation:none;-ms-animation:none;animation:none}</style></noscript> |
in the header of my amplayout.tpl
[/code] |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Apr 25, 2017 9:13 pm Post subject: |
|
|
Either change tag delimiters for a template, add spaces after "{" to prevent CSS being parsed as Smarty tags, or use {literal} tags for the same purpose.
Not to mention, I don't understand why you're including this dump into a template in first place. |
|
Back to top |
|
anything7pob Smarty Rookie
Joined: 26 Mar 2017 Posts: 26
|
Posted: Tue Apr 25, 2017 9:46 pm Post subject: |
|
|
Hi and thank you, ill work through your tips, sure one will fix it.
I`m pretty new to messing around with AMP but I believe that dump is non negotiable and needs to be in the header of the page.
Unless you are suggesting said dump would be better dumped in the index.php or maybe in that under public html file that I need to make..
I need to put it in the root file and make it a smarty variable....doh! |
|
Back to top |
|
AnrDaemon Administrator
Joined: 03 Dec 2012 Posts: 1785
|
Posted: Tue Apr 25, 2017 10:35 pm Post subject: |
|
|
If it 100% required to be a part of the page, then use {literal} .. {/literal} to escape its parsing. |
|
Back to top |
|
|