Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2007-11-29 20:04:24
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
categories and syntax...
Hello,
I’ve been sifting through the support forum and the FAQ but i can’t seem to find the answer to a simple question, its probably really easy, but i just can’t find it. If someone could drop a note and help me out i would be very appreciative.
Is it possible to do something like this:
<txp:article_custom limit=“5” section=“weirdsection” category=“ohio, cars” />
<txp:article_custom limit=“2” section=“weirdsection” category=“iowa, cars” />
So that textpattern will only display articles that are in ‘weirdesction’ and only if contained both in “ohio” and “cars” So in this case ohio will get 5 articles and iowa will only get 2 articles, both dealing with cars.
if i use this set up:
<txp:article_custom limit=“2” section=“weirdsection” category=“iowa” category=“cars” />
it will display everything both ohio and iowa because they have a second category of cars.
Sorry if it sounds confusing. But thanks to anyone that can point me in the right direction.
cheers
Nadine.
Offline
#2 2007-11-29 20:40:33
- Logoleptic
- Plugin Author
- From: Kansas, USA
- Registered: 2004-02-29
- Posts: 482
Re: categories and syntax...
I’m pretty sure you can only use the category
attribute once in a template tag, so the second example won’t work. I also don’t see any mention of this tag being able to take comma-separated values in its TextBook entry, though if it could then it would give you articles matching either category.
There’s a plugin called chh_article_custom that can do some of what you seem to be after. Perhaps it could help. Check the plugin’s attribute reference for details.
Offline
#3 2007-11-29 21:12:12
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
Re: categories and syntax...
Thanks for the links and suggestions, i will check them out. :)
Offline
#4 2007-11-30 06:25:11
- _n
- Member
- Registered: 2005-07-13
- Posts: 44
Re: categories and syntax...
Hmm, here’s another question…
Is there a way to make a simple linear navigation for articles using just the <txp:article_custom /> tag? Actually this goes for the chh_article_custom tag too…its the only topic they don’t really talk about or that i can’t get a sense of through the attributes page…
So for example being able to use: <txp:link_to_prev>previous</txp:link_to_prev> but have it only go through articles in a particular combo like:
<txp:article_custom limit=“1” section=“mySection” category=“myCategory” />
as using this:
<txp:if_individual_article><p><txp:link_to_prev>Previous</txp:link_to_prev><txp:link_to_next>Next</txp:link_to_next></p></txp:if_individual_article>
<txp:if_article_list><p><txp:older>Previous</txp:older><txp:newer>Next</txp:newer></p></txp:if_article_list>
only works properly for <txp:article />
Thanks!
Nadine.
Offline
Re: categories and syntax...
I can’t think of a way of producing a “single” link as in prev/next however there is the <txp:related_articles /> tag which enable you to pull out a list of articles related both by section and category which could be placed beneath the article or article list.
or
You could try using the <txp:asy_wondertag /> plug-in with the <txp:article_custom /> tag and do something like:-
<txp:asy_wondertag><txp;article_custom section="<txp:section />" category="<txp:category />" form="formName" limit="999" /></txp:asy_wondertag>
where the form contains just the title tag wrapped in permlink tags. This method is a little more “automated” as it will look at the section/category that you are currently in. In either case you could maybe place the resulting list in your sidebar if you have one under a title like “From here you can also look at…”.
Just some ideas. :)
Last edited by thebombsite (2007-11-30 11:31:59)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
Pages: 1