can you use json in the head to assign current page url to smarty variable
Design and Skin Customization
heres the situation, i am working my way through developing a pro user tip to enable amp (accelerated mobile pages) functionality wich they say will give you higher rankings and referential treatment in mobile searches.
i have 99% of it figured out except for this
taken from the tech docs on amp
Linking pages with
In order to solve this problem, we add information about the AMP page to the non-AMP page and vice versa, in the form of
tags in the
.
Add the following to the non-AMP page:
<link rel="amphtml" href="https://www.example.com/url/to/amp/document.html">
And this to the AMP page
<link rel="canonical" href="https://www.example.com/url/to/full/document.html">
What if I only have one page?
If you only have one page, and that page is an AMP page, you must still add the canonical link to it, which will then simply point to itself:
<link rel="canonical" href="https://www.example.com/url/to/amp/document.html">
i edited the header.tpl to load a amp_meta.tpl when users on mobile, and not logged in
i will edit every page calling the header.tpl to call a amp_header.tpl when mobile and not logged in, this will include a message "you are viewing an accelerated mobile page, please join, or login for full functionality, and the most up to date content'
the regular meta.tpl will have link to amp url, wiich will simply be the http version of the url
while amp_meta.tpl will have the canonical link to the https version of the current url
heres the big problem, every module builds the urls based off base_url module url user id etc etc
that simply will not work for what i need
i need a json script (do they work in the head) or some way of capturing {this-url} minus the http/https assigning it to a smarty variable and in the link code just do http or https://{thisurl}
i hope that makes sense
once this problems figured out i should have a relatively easy way to make your whole site amp compliant
(though it may need testing and refining)
i am very close to having it figured out, just stuck on this 1 lil detail
updated by @soaringeagle: 04/28/16 02:04:22PM