Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-05-26 06:00:51

Locutionist
Member
From: The mountains, central PA, USA
Registered: 2005-08-15
Posts: 57
Website

link to category page, then sort by cat2?

Hey all, looking for suggestions how I might get this to work.

I have a standard linked category list; what I want to do is have the linked page display the article list sorted by cat2, with a label displaying the cat2 title. I really need to automate this so I don’t have to create separate article tags for all the individual cat1-cat2 combinations. I tried using rss_suparchive_bycat, but it doesn’t seem to like useartcat2=1 on a page with /category/cat1 in the URL.

in case that’s not clear at this ridiculous hour, maybe this helps clarify:

the URL looks like this:
domain.com/category/cat1name

on the page I want this:

Cat2 Title One
  • Article 1
  • Article 2
  • Article 3
Cat2 Title Two
  • Article 1
  • Article 2
  • Article 3
Cat2 Title Three
  • Article 1
  • Article 2
  • Article 3

…and I need it to generate that structure automatically, but rss_suparchive_bycat spits out a SQL syntax error. Hopefully that makes sense. Thanks in advance if anyone can help.

—paula

Last edited by Locutionist (2008-05-26 06:02:46)

Offline

#2 2008-05-26 08:58:52

ruud
Developer Emeritus
From: a galaxy far far away
Registered: 2006-06-04
Posts: 5,068
Website

Re: link to category page, then sort by cat2?

Try combining <txp:article sort=“category2 ASC” /> with the <txp:if_different> tag to only show the category title when it differs from the previous article.

Offline

#3 2008-05-26 09:34:38

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

Re: link to category page, then sort by cat2?

ruud wrote:

Try combining <txp:article sort=“category2 ASC” /> with the <txp:if_different> tag to only show the category title when it differs from the previous article.

ruud, the problem here is that this works without problems only if you are not wanting to generate a nested unordered list. (see this post).
If you need a nested unordered list you can adopt 2 solutions: one is based on css (see post linked before) or you must insert a little php in your article form.
But wait. Maybe the new plugin smd_query can be useful here.
edit: mmh… no, I think it can ‘t, maybe smd_if but I think it lacks an “ if_different” operator

Last edited by redbot (2008-05-26 16:38:38)

Offline

#4 2008-05-26 15:08:17

Locutionist
Member
From: The mountains, central PA, USA
Registered: 2005-08-15
Posts: 57
Website

Re: link to category page, then sort by cat2?

Hey guys, thanks so much! I must admit I don’t really understand how the if_different tag works but I will certainly give it a shot. My article list doesn’t have to be wrapped in list tags — semantically that would be proper, but it is more important to automate the output.

I’ll see if I can get either of these to work and let you know.

—paula

Offline

Board footer

Powered by FluxBB