Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2009-10-22 18:44:19

Chiriohs
New Member
From: OK, USA
Registered: 2009-10-15
Posts: 4
Website

Articles listed by category problem..

I have my category list in my sidebar. I have it so when a person clicks on a category they’ll see a list of articles in that category with the title of the category they clicked above the list. The category sidebar lists both from category1 and category2 (obviously), so when there’s an article with two categories defined, it shows up in both lists. That’s great, I like that.

My problem is, when an article has a category1 as “X”, and category2 as “Y”, when you click category “Y” in the sidebar, there will be a second title for that one article’s category1 (category “X”) underneath the first list with the desired title (category “Y”).

So, long story short, how do I keep that category1 title from showing up if the article is in the list because of its category2?

Lol…..that all reads very confusing….

Here’s where the problem is: http://henager.net/category/pets/

And here’s the form I’m using to show the list:

<txp:if_different>
<h3><txp:category1 title=1 /></h3>
</txp:if_different>
<!-- article title and link -->
<txp:posted format="%m/%d/%Y" /> &#183; <txp:section title="1" /> &#183; <txp:permlink><txp:title /></txp:permlink>
<br />

“Degradation – Sometimes mispronounced “degration”, as in, “there’s a degration of the English language going on and nobody notices”.” – David Miller (http://innersting.blogspot.com/)

Offline

#2 2009-10-22 19:07:22

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Articles listed by category problem..

It’s not the only problem (if you ask me), e.g. if you click the “Abode” link the category title that appears is “Interests”. Try using the category tag instead of category1, and put it outside the article form.


Code is topiary

Offline

#3 2009-10-22 19:21:57

Chiriohs
New Member
From: OK, USA
Registered: 2009-10-15
Posts: 4
Website

Re: Articles listed by category problem..

Well whadduyaknow…had no idea it was that simple, lol… Worked both inside and outside of the form, too! I went ahead and left it outside the form, though.

That abode link had the same problem as pets, because “abode” was the category2 of that article, and interests was category1.

Thanks very much, jsoo (again, lol)!

Last edited by Chiriohs (2009-10-22 19:22:37)


“Degradation – Sometimes mispronounced “degration”, as in, “there’s a degration of the English language going on and nobody notices”.” – David Miller (http://innersting.blogspot.com/)

Offline

#4 2009-10-22 20:09:23

jsoo
Plugin Author
From: NC, USA
Registered: 2004-11-15
Posts: 1,793
Website

Re: Articles listed by category problem..

Yes, you could leave the category tag inside the form, but only if you keep the if_different block. Since you only want a single category to appear, cleaner to leave it outside the form.


Code is topiary

Offline

#5 2009-10-28 11:40:05

Gallex
Member
Registered: 2006-10-08
Posts: 1,308

Re: Articles listed by category problem..

Chiriohs wrote:

And here’s the form I’m using to show the list:
bc. <txp:if_different>
<h3><txp:category1 title=1 /></h3>
</txp:if_different>
<!— article title and link —>
<txp:posted format=”%m/%d/%Y” /> · <txp:section title=“1” /> · <txp:permlink><txp:title /></txp:permlink>
<br />

could you please show me your sidebar’s category list code too?
i would like to create something similar.

Offline

Board footer

Powered by FluxBB