Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-10-15 12:18:43

sparkymalarky
New Member
Registered: 2007-10-15
Posts: 3

List all articles in section *without* specifying section

If I have a section, say “mysection” that someone is browsing, how do I list all articles in that section? I know I can do a article_custom and actually specify the section name “mysection”, but then I have to have a different form for each section as I’m hardcoding the section. Is there any way of displaying a list of articles in the “current” section as it were? I thought recent_articles might restrict to the current section but it doesnt appear to.

Thanks

Marcus

Offline

#2 2007-10-15 13:11:29

Dragondz
Moderator
From: Algérie
Registered: 2005-06-12
Posts: 1,538
Website GitHub Twitter

Re: List all articles in section *without* specifying section

Hi marcus

you can use txp:article that list articles in the section or category

Offline

#3 2007-10-15 13:16:26

sparkymalarky
New Member
Registered: 2007-10-15
Posts: 3

Re: List all articles in section *without* specifying section

Mmmm – I’ve tried that but then when a user navigates to one of the articles in the section the list output by the article tag only points to the current article, not to all articles in the section.

I should maybe explain what I’m trying to do…

Basically I’m using txp for a fairly static site, so sections each have a multiple articles that represent pages in the site heirarchy:

Section1 – page1, page2, page3
Section2 – page4, page5, page6
Section3 – page7

Each section has a single “sticky” article that is displayed on the sections default/landing page “/Section1”, the rest are listed in a sidebar as a navigable list. So when someone goes to page2 in section1 the list should still display page1, page2 and page3.

If I can do it without hardcoding a section name I can have a single page template for all of these pages, if not I have to have 3 different pages where only the section name in this list will change.

Marcus

Last edited by sparkymalarky (2007-10-15 13:21:27)

Offline

#4 2007-10-16 13:36:52

michaelkpate
Moderator
From: Avon Park, FL
Registered: 2004-02-24
Posts: 1,379
Website GitHub Mastodon

Re: List all articles in section *without* specifying section

Have you looked at the functionality offered by txp:if_section? I often use this statement to make the same page code reusable.

Offline

#5 2007-10-16 17:17:49

redbot
Plugin Author
Registered: 2006-02-14
Posts: 1,410

Re: List all articles in section *without* specifying section

Have you tried combining article_custom with asy_wondertag plugin (tags in tags)?
You should use it this way:

<txp:asy_wondertag>
<txp:article_custom section=”<txp:section />”
</txp:asy_wondertag>

In this case you won’t need to hardcode section names. you only need one page template

Offline

#6 2007-10-24 14:35:58

sparkymalarky
New Member
Registered: 2007-10-15
Posts: 3

Re: List all articles in section *without* specifying section

Perfect – just what I needed. Will check out the plugin now. Thanks

Offline

#7 2008-02-06 14:29:18

ABDC
Member
From: the Netherlands
Registered: 2006-08-14
Posts: 17
Website

Re: List all articles in section *without* specifying section

That would be the perfect plugin, but I cannot find it on textpattern.org? Where can I find some information please?

Offline

#8 2008-02-06 14:32:07

ABDC
Member
From: the Netherlands
Registered: 2006-08-14
Posts: 17
Website

Re: List all articles in section *without* specifying section

OK, found it sorry. Here it is: http://forum.textpattern.com/viewtopic.php?id=18593

Offline

#9 2008-02-06 15:04:52

jordi
Member
From: Barcelona
Registered: 2005-09-14
Posts: 94
Website

Re: List all articles in section *without* specifying section

I may be missing something here, but I think Dragondz is right, as txp:article pulls only articles from the current section. Wouldn’t this be enough for what you try to accomplish?

If you put the tag in the sidebar, say like this:
<code><txp:article limit=“3” form=“myform” />

and in “my form”:
<code><txp:permlink><txp:title /></txp:permlink></code>

you should get links to all 3 articles.

Last edited by jordi (2008-02-06 15:10:58)

Offline

Board footer

Powered by FluxBB