Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-07-07 17:08:09

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 251
Website

permlink with title

Hello, what I’d like to see is something like this

<txp:permlink id="54" title="1" />

(I suppose when used only within a page)

Cheers

Offline

#2 2011-07-08 01:06:10

tye
Member
From: Pottsville, NSW
Registered: 2005-07-06
Posts: 859
Website

Re: permlink with title

If I understand correctly – txp:permlink already does have a title tag

Offline

#3 2011-07-08 08:16:18

Manaus
Member
From: Turin, Italy
Registered: 2010-10-22
Posts: 251
Website

Re: permlink with title

Unfortunately, it is coupled with the title attribute of the tag a
What I was thinking to, is a way to avoid writing <txp:permlink id="n">This text</txp:permlink>

Last edited by Manaus (2011-07-08 08:17:27)

Offline

#4 2011-07-08 08:18:26

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: permlink with title

I take it that <txp:permlink id="54"><txp:title /></txp:permlink> is not satisfactory for what you need?

I was writing the above before you posted:)

Last edited by colak (2011-07-08 08:19:13)


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#5 2011-07-08 08:23:12

wet
Developer Emeritus
From: Schoerfling, Austria
Registered: 2005-06-06
Posts: 3,330
Website Mastodon

Re: permlink with title

wet_link renders <txp:wet_link href="42" title="" /> into <a href="http://example.com/article/foo-bar">Foo Bar</a>.

Offline

#6 2011-07-08 08:56:18

Gocom
Developer Emeritus
From: Helsinki, Finland
Registered: 2006-07-14
Posts: 4,533
Website

Re: permlink with title

Also one could go nuts with yield and output_form, coupled with article_custom, title and permlink.

For example one could create a form named as “p” with the following contents:

<txp:article_custom id='<txp:yield />'>
	<a href="<txp:permlink />"><txp:title /></a>
</txp:article_custom>

Everything wrapped by output_form tags would be used as the article ID and the title would be automatically included in the link. Then to generate link to an article one could simply do:

<txp:output_form form="p">54</txp:output_form>
<txp:output_form form="p">75</txp:output_form>
<txp:output_form form="p">138</txp:output_form>

Which would produce:

<a href="http://example.com/bar/foobar">FooBar</a>
<a href="http://example.com/foo/barfoo">BarFoo</a>
<a href="http://example.com/barfoo/boofar">Boofar</a>

Last edited by Gocom (2011-07-08 09:01:46)

Offline

Board footer

Powered by FluxBB