Smarty Forum Index Smarty
The discussions here are for Smarty, a template engine for the PHP programming language.

Google amp project

 
Post new topic   Reply to topic    Smarty Forum Index -> General
View previous topic :: View next topic  
Author Message
gtraxx
Smarty Regular


Joined: 08 Jan 2008
Posts: 56

PostPosted: Fri Mar 24, 2017 9:52 am    Post subject: Google amp project Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1646

PostPosted: Fri Mar 24, 2017 9:56 am    Post subject: Reply with quote

Yes, it is possible. Just like any other content. Not only webpages.
Back to top
View user's profile Send private message
gtraxx
Smarty Regular


Joined: 08 Jan 2008
Posts: 56

PostPosted: Fri Mar 24, 2017 9:59 am    Post subject: Reply with quote

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
View user's profile Send private message
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1646

PostPosted: Fri Mar 24, 2017 10:07 am    Post subject: Reply with quote

There's entire documentation of examples.
If you explain, what you have difficulties with, it will be easier to help you.
Back to top
View user's profile Send private message
adn
Smarty Regular


Joined: 31 May 2011
Posts: 91

PostPosted: Wed Mar 29, 2017 2:10 pm    Post subject: Reply with quote

No specific things

Personnaly I just created templates for amp pages. My amp pages have a param &amp and when I detect it I use others templates. Easy
Cool
_________________
http://www.letsGarden.info
Back to top
View user's profile Send private message Visit poster's website
anything7pob
Smarty Rookie


Joined: 26 Mar 2017
Posts: 26

PostPosted: Tue Apr 25, 2017 7:51 pm    Post subject: Reply with quote

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

Confused [/code]
Back to top
View user's profile Send private message Send e-mail
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1646

PostPosted: Tue Apr 25, 2017 9:13 pm    Post subject: Reply with quote

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
View user's profile Send private message
anything7pob
Smarty Rookie


Joined: 26 Mar 2017
Posts: 26

PostPosted: Tue Apr 25, 2017 9:46 pm    Post subject: Reply with quote

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
View user's profile Send private message Send e-mail
AnrDaemon
Administrator


Joined: 03 Dec 2012
Posts: 1646

PostPosted: Tue Apr 25, 2017 10:35 pm    Post subject: Reply with quote

If it 100% required to be a part of the page, then use {literal} .. {/literal} to escape its parsing.
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic    Smarty Forum Index -> General All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP