Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-01-23 19:16:27

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

custom article lists by category

I’m trying to create some custom pages on a per category basis…
The idea i am working on is not working out… I wonder if anyone can spot where I’m going wrong…

<txp:if_search>
foo
<txp:else />
<txp:if_category name="categoryA">
<txp:article_custom category="categoryA" section="Section" form="thumbs"  limit="100" />
also something here
<txp:else />
<txp:article limit="10" />
</txp:if_category>
<txp:if_category name="categoryB">
<txp:article_custom category="categoryB" section="Section" form="thumbs"  limit="100" />
also something else here
<txp:else />
<txp:article limit="10" />
</txp:if_category>
<txp:else />

</txp:if_search>

The problem with the above is when I am in the /category/categoryA or category/categoryB page I also see the 10 entries below the thumbs…

What I am trying is to show just the thumbs without any other extra data… I can understand why it is happening but I can not figure out how to avoid it…

I also tried

<txp:if_search>... foo
<txp:if_category name="categoryA">
<txp:article_custom category="categoryA" section="Section" form="thumbs"  limit="100" />
also something here
<txp:else />
<txp:if_category name="categoryB">
<txp:article_custom category="categoryB" section="Section" form="thumbs"  limit="100" />
also something else here
</txp:if_category>
<txp:else />
<txp:article limit="10" />
</txp:if_category>
</txp:if_search>

any ideas????

Last edited by colak (2007-01-23 19:52:57)


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

Offline

#2 2007-01-23 20:42:28

anoke
Archived Plugin Author
Registered: 2006-04-15
Posts: 152

Re: custom article lists by category

(Sorry, Can’t check this idea right now) Might this work?

<txp:if_search> foo <txp:else />

<txp:if_category name="">
<txp:article limit="10" />
</txp:if_category>

<txp:if_category name="categoryA">
<txp:article_custom category="categoryA" section="Section" form="thumbs"  limit="100" />
also something here
</txp:if_category>

<txp:if_category name="categoryB">
<txp:article_custom category="categoryB" section="Section" form="thumbs"  limit="100" />
also something else here
</txp:if_category>

</txp:if_search>

BTW1, you had that search conditional differently between the examples. Just a typo or do you want to somehow filter search results? (of which I have no idea…)

BTW2, Is there some reason why you use article_custom? Or do you want to display articles from another section when browsing those two categories?


- When chickens are cold, they roost in trees; when ducks are cold, they plunge into water -

Offline

#3 2007-01-23 22:01:29

els
Moderator
From: The Netherlands
Registered: 2004-06-06
Posts: 7,458

Re: custom article lists by category

You were nesting two identical conditionals (if_category), that’s why it didn’t work.
You could also use asy_wondertag and do this:

<txp:if_category name="categoryA,categoryB">
<txp:asy_wondertag><txp:article_custom category="<txp:category />" section="Section" form="thumbs"  limit="100" /></txp:asy_wondertag>
<txp:else />
<txp:article limit="10" />
</txp:if_category>

Offline

#4 2007-01-24 08:49:03

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

Re: custom article lists by category

worked it out
for future reference here’s the code

<txp:if_search>
foo
<txp:else />
<txp:if_category name="A,B">
<txp:article listform="thumbs"  limit="100" />
<txp:else />
<txp:article limit="10" />
</txp:if_category>

<txp:if_category name="A">
<txp:something here />
</txp:if_category>

<txp:if_category name="B">
<txp:something else here />
</txp:if_category>

</txp:if_search>

Els thank you again for all you help in the last few days. Really appreciated

Aaaaaaaand here are the results category A , category B and any category

Last edited by colak (2007-01-24 13:22:05)


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