Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-25 00:02:42

makenosound
Member
Registered: 2005-08-05
Posts: 12

use if_category for individual articles

I’m looking at creating a fairly large site using Textpattern to manage the content. For the most part it’s just about right, but I’m struggling to sort out one thing which would seal the deal.

Basically the site consists of the three sections, with 5 global categories. Each section needs to be branded seperately (simple enough) and, here’s where I’m running into trouble, each category needs to use a different form to display the atricle information. I can’t use the form override because it forces the same form to be used for both article lists and individual articles.

I’m using <code><txp:if_category></code> for article lists and specifying a form to use in <code><txp:article /></code>, but when I view an individual article the category information is not passed on, so I can’t use <code><txp:if_category></code> to force the use of a specific form for each category.

Any ideas on how to acheive this?

I figured maybe changing the archive structure to reflect category information for all links would be the right approach (I.e section/category/id/title), but I’m not exactly sure how to go about this.

Any help would be much appreciated.

Offline

#2 2005-11-25 00:15:08

zem
Developer Emeritus
From: Melbourne, Australia
Registered: 2004-04-08
Posts: 2,579

Re: use if_category for individual articles

Sounds like you might need to use if_article_category instead of if_category. See Textbook for more info.

[edit] I added a new FAQ.

Last edited by zem (2005-11-25 00:19:56)


Alex

Offline

#3 2005-11-25 00:26:53

makenosound
Member
Registered: 2005-08-05
Posts: 12

Re: use if_category for individual articles

Cheers, Zem. Though wouldn’t you know, the second I posted I came across if_article_category and it all became so simple.

Offline

#4 2006-03-10 05:57:21

jessejericho
Member
Registered: 2005-10-29
Posts: 25

Re: use if_category for individual articles

I cannot get if_category or if_article_category to work, would someone mind posting up an example of how one would use these tags? It would be much appreciated.

Offline

#5 2006-03-10 06:02:16

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: use if_category for individual articles

TextBook contains explanations for where they work and examples: if_article_category and if_category.

Offline

#6 2006-03-10 06:04:19

jessejericho
Member
Registered: 2005-10-29
Posts: 25

Re: use if_category for individual articles

Mary wrote:

TextBook contains explanations for where they work and examples: if_article_category and if_category.

Mary I’m sorry to say that I have looked at those explanations a million times in the last couple days, and I can’t figure it out. I’m very new to TXP, and I must be missing something important. I know its probably right in front of my face, but I cant seem to figure it out :(

Offline

#7 2006-03-10 06:08:34

Mary
Sock Enthusiast
Registered: 2004-06-27
Posts: 6,236

Re: use if_category for individual articles

Could you describe what it is you’re trying to do? Then we could show you how to go about it.

Offline

#8 2006-03-10 06:17:01

jessejericho
Member
Registered: 2005-10-29
Posts: 25

Re: use if_category for individual articles

Ok I’ll try to explain this as best I can, please bear with me.

I am building a portal that includes the sites of 3 restaurants. So restaurant1 = section1, restaurant2 = section2, et cetera. Each of these restaurants has a navigation structure like “About Us”, “Dining”, “Pub”, “Weddings” etc. Below these “sub-sections” are another level of navigation, like “About Us” -> “History, Photos, Directions, Contact”. So I thought I could use rdt_dynamenus, making the restaurants sections, the first level nav stickied, and the 2nd level nav regular articles.

The problem is that I only want certain articles withing the restaurant section to show up in the navbar. This works for the stickied articles, but for the 2nd level nav I think I would need to use categories, and in order to do so, I think I would need to use an if_category or if_article_category to sort it out.

I am totally confused, but I hope I haven’t confused you :P Here is an image that makes it slightly easier (i think) to sort out:

Offline

#9 2006-03-10 06:23:00

jessejericho
Member
Registered: 2005-10-29
Posts: 25

Re: use if_category for individual articles

I was thinking about just making a static navbar, because these things aren’t really going to change. I would like to keep them dynamic, but it I’m not sure its entirely necessary. However, my if_category problem still exists.

Offline

#10 2006-03-10 16:53:46

jessejericho
Member
Registered: 2005-10-29
Posts: 25

Re: use if_category for individual articles

Ok I have figured out if_article_category, and seem to have it working. I’m not sure its exactly what I need, so if anyone has a better suggestion to do what I outlined above, please let me know ;)

Offline

Board footer

Powered by FluxBB