Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2012-03-27 08:28:20

Gallex
Member
Registered: 2006-10-08
Posts: 1,304

[textile] <txp:permlink /> inside article

what’s wrong with this code? it doesn’t work.

p(meta). <a href="<txp:permlink />"  class="read-on">read on</a>

i use it inside article

Offline

#2 2012-03-27 08:34:12

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,394
Website GitHub

Re: [textile] <txp:permlink /> inside article

Try:

p(meta). ==<a href="<txp:permlink />"  class="read-on">read on</a>==

It’ll probably be Textile converting the quotes wrongly.


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 2012-03-27 09:56:29

Gallex
Member
Registered: 2006-10-08
Posts: 1,304

Re: [textile] <txp:permlink /> inside article

not working that way also.
it can’t be quotes, because it works that way:

p(meta). <a href="/partners"  class="read-one">read on</a>

Offline

#4 2012-03-27 10:10:47

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,394
Website GitHub

Re: [textile] <txp:permlink /> inside article

Gallex wrote:

it can’t be quotes

Why not? When Textile replaces the permlink tag with the actual link it wrongly converts some quotes with their HTML equivalents. Your hard-coded version doesn’t contain a Txp tag so it won’t have any problems.

Trying your original version I see this in the source code:

<p class="meta"><a href="http://site.com/articles/gallex&#8220 ;  class=&#8220 ;read-on&#8221 ;&gt ;read on</a></p>

Which is broken HTML [EDIT: had to put spaces before the semicolons to prevent forum Textile from mangling the code!]

Putting the double-equals around the anchor stops Textile from converting things wrongly:

<p class="meta"><a href="http://site.com/articles/gallex"  class="read-on">read on</a></p>

In your case of course it might not be that at all. You can prove it one way or the other by temporarily turning off Textile processing (“leave text untouched” from the Advanced twisty). If it works when that’s switched off then it’s Textile getting in the way. If not, ummmm, dunno.

Last edited by Bloke (2012-03-27 10:12:45)


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

#5 2012-03-27 10:35:27

Gallex
Member
Registered: 2006-10-08
Posts: 1,304

Re: [textile] <txp:permlink /> inside article

sorry bloke, yes it works with double-equals, but not without it. ‘leave text untoched’ didn’t change anything

Offline

#6 2012-03-27 10:51:31

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: [textile] <txp:permlink /> inside article

i use it inside article

Article form or article body/excerpt?

In form:

<p class="meta"><a href="<txp:permlink />"  class="read-on">read on</a></p>

In body/excerpt … Try to eliminate textile completely:

notextile. <p class="meta"><a href="<txp:permlink />"  class="read-on">read on</a></p>

Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

#7 2012-03-27 11:54:17

Gallex
Member
Registered: 2006-10-08
Posts: 1,304

Re: [textile] <txp:permlink /> inside article

in excerpt. yes merzi, that way it’s working

Offline

#8 2012-03-27 16:16:13

merz1
Member
From: Hamburg
Registered: 2006-05-04
Posts: 994
Website

Re: [textile] <txp:permlink /> inside article

Well, no idea why your original code shouldn’t work but glad I could help.

If you always – let’s say in 95% – have excerpts leading to a longer version i would recommend to put that HTML/TXP markup into the article form to have the advantage of an always on automatic ‘read more’ link.

<txp:if_excerpt>
<txp:excerpt />
<p><a href="<txp:permlink />" title="<txp:title />" rel="bookmark"><strong>Read more&hellip;</strong></a></p>
<txp:else />
<txp:body />
</txp:if_excerpt>

Last edited by merz1 (2012-03-27 16:16:52)


Get all online mentions of Textpattern via OPML subscription: TXP Info Sources: Textpattern RSS feeds as dynamic OPML

Offline

Board footer

Powered by FluxBB