Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#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
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
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
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
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
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