Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
'absolute' attribute on txp:permlink
I saw another thread on the topic of absolute vs. relative urls generated by permlink. In general I like that relative permalinks are created, because the browser knows how to fix them up. I have since found a very compelling use case to have an option to create absolute URLs via txp:permlink.
There are many ‘widgets’ today that allow social linking and other inline capabilities (my use case is addthis). Many of those widgets let you optionally provide the URL rather than taking the page URL (useful for article lists). However, I have found some of these widgets aren’t as smart as the browser about fixing up the internal site link to add the http://domain prefix.
For those cases I woudl find it very useful if there was an attribute on txp:permlink like absolute=“1” to enable full URL.
Offline
Re: 'absolute' attribute on txp:permlink
mericson wrote:
For those cases I woudl find it very useful if there was an attribute on txp:permlink like absolute=“1” to enable full URL.
In such cases, can the following syntax help?
<a href="<txp:site_url /><txp:permlink />">Add this</a>
Without knowing anything about addthis I dunno if that’s useful.
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
#3 2011-02-21 21:40:24
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: 'absolute' attribute on txp:permlink
I always thought the permlink tag did output the absolute URL? If not, what is that hu
in the code?
Offline
Re: 'absolute' attribute on txp:permlink
Els wrote:
I always thought the permlink tag did output the absolute URL? If not, what is that
hu
in the code?
So did I, but mericson implies not. I can’t remember the truth! hu
should be good enough to guarantee an absolute URL.
Last edited by Bloke (2011-02-21 21:55:30)
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
Offline