Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2011-05-24 08:59:14

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

Generate contextual section links

Hello, I need to generate, in each article, all the articles pertaining to the section.

I tried this code:

	<txp:article_custom section="<txp:section />">
	<li><txp:permlink><txp:title /></txp:permlink></li>
	</txp:article>

but the page returns null.

Thanks for any help

Offline

#2 2011-05-24 09:32:57

jakob
Admin
From: Germany
Registered: 2005-01-20
Posts: 5,001
Website GitHub

Re: Generate contextual section links

You need to use single quotes when using txp:tags as attributes of another txp:tag:

	<txp:article_custom section='<txp:section />'>
	<li><txp:permlink><txp:title /></txp:permlink></li>
	</txp:article>

TXP Builders – finely-crafted code, design and txp

Online

#3 2011-05-24 10:06:34

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

Re: Generate contextual section links

You also need to use </txp:article_custom> as your closing tag :-)


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

#4 2011-05-24 12:01:42

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

Re: Generate contextual section links

Manaus wrote:

Hello, I need to generate, in each article, all the articles pertaining to the section.

If you have a lot of articles you’ll also need to add a high enough limit otherwise it’ll just return the last 10 entries.

	<txp:article_custom section='<txp:section />' limit="999">
...

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

Offline

Board footer

Powered by FluxBB