Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
permlink
I’m not sure if it is a bug but when I use <txp:permlink id="1"><txp:title /></txp:permlink>
in an article, it returns the current article’s title
, linked to the article with the id I specify.
ie. Instead of producing <a rel="bookmark" href="https://example.com/index.php?id=2">Linked article title</a>
, it returns <a rel="bookmark" href="https://example.com/index.php?id=2">Current article title</a>
.
I would expect that <txp:title />
would respond contextually, as it is described in the docs here and here.
>Edit:
Interestingly if I wrap the tags in article_custom
, <txp:article_custom><txp:permlink id=“1”><txp:title /></txp:permlink></txp:article_custom>
it returns
<a rel="bookmark" href="https://example.com/index.php?id=1">Current article title</a><a rel="bookmark" href="https://example.com/index.php?index.php?id=1">Linked article title</a>
Last edited by colak (2025-07-20 05:37:34)
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: permlink
Which version of Txp? Has permlink ever changed context, given it is designed to be used within an article to return the current article link? It does kind of feel as if it should temporarily switch context if used with the ID attribute.
In the meantime, you can cheat by wrapping the permlink tag with article_custom id=“xx”.
The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.
Txp Builders – finely-crafted code, design and Txp
Offline
Re: permlink
Bloke wrote #340013:
Which version of Txp? Has permlink ever changed context, given it is designed to be used within an article to return the current article link? It does kind of feel as if it should temporarily switch context if used with the ID attribute.
In the meantime, you can cheat by wrapping the permlink tag with article_custom id=“xx”.
I tested in Pete’s current dev install as well as on my 4.9.0-dev (d72fbb8ac8a902583c01b17537647986). I was actually thinking of using the article_custom
tag, but as it will be an article with over 150 internal links, it would be a bloat.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: permlink
I was just thinking that the cool functions of the permilnk
& title
is that they can automatically update when there is a change in the article URL patterns, or a change in the title
. After we use them, we can stop thinking about them.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Re: permlink
FWIW, I can reproduce this with TXP 4.9-dev and TXP 4.8.8.
This works fine (4.9-dev):
<txp:article_custom id="xxx"><txp:permlink><txp:title /></txp:permlink></txp:article_custom>
If needed multiple times I’d build a simple <txp:shortcode />
.
Where is that emoji for a solar powered submarine when you need it ?
Sand space – admin theme for Textpattern
phiw13 on Codeberg
Offline
Re: permlink
Thanks so much Philippe. I opted to go for: <a rel="bookmark" href='<txp:permlink id="2208" />'>my title</a>
as it is needed over 150 times. If there was another two fields in the links pane, I would have done it all in there.
Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.
Offline
Pages: 1