Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2016-06-17 12:56:46

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

site_url and page_url ... how do I add them together correctly?

If I use <txp:site_url /><txp:page_url /> I get > <link rel="amphtml" href="https://mercury.postlight.com/amp?url=http://www.misterdutch.nl/new//new/blog/het-vorige-inburgeringsexamen-was-een-beetje-een-slap-examen"> … :(

If I use http://www.misterdutch.nl<txp:page_url /> I get > <link rel="amphtml" href="https://mercury.postlight.com/amp?url=http://www.misterdutch.nl/new/blog/het-vorige-inburgeringsexamen-was-een-beetje-een-slap-examen"> … :)

Can I tweak <txp:site_url /><txp:page_url /> in such a way so I can get a correct output?

BTW … I’m investigating > Postlight Mecury (With one line of code, Postlight Mercury readies your publication for Google AMP) … and it looks promising.

Last edited by RedFox (2016-06-17 13:49:16)

Offline

#2 2016-06-17 14:27:42

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: site_url and page_url ... how do I add them together correctly?

RedFox wrote #299804:

Can I tweak <txp:site_url /><txp:page_url /> in such a way so I can get a correct output?

That isn’t an individual article page, correct? Why not just use:

 <link rel="amphtml" href="https://mercury.postlight.com/amp?url=<txp:permlink />">

Offline

#3 2016-06-17 15:09:18

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: site_url and page_url ... how do I add them together correctly?

michaelkpate wrote #299810:

That isn’t an individual article page, correct? Why not just use:

<link rel="amphtml" href="https://mercury.postlight.com/amp?url=<txp:permlink />">

It has to work on all pages … individual and landing. txp_permlink gives an error on the landing page … not on the individual page.

Offline

#4 2016-06-17 15:36:23

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: site_url and page_url ... how do I add them together correctly?

From https://github.com/textpattern/textpattern-default-theme/blob/master/src/pages/archive.txp

    <!-- specify canonical and author -->
    <txp:if_individual_article>
        <link rel="canonical" href="<txp:permlink />">
        <txp:meta_author title="1" />
    <txp:else />
        <link rel="canonical" href="<txp:section url="1" />">
    </txp:if_individual_article>

Offline

#5 2016-06-17 19:58:24

RedFox
Member
From: Netherlands
Registered: 2005-03-25
Posts: 805
Website

Re: site_url and page_url ... how do I add them together correctly?

Thanks Michael … also for the link … :)

Offline

Board footer

Powered by FluxBB