Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-02-16 21:45:26

joncrain
New Member
Registered: 2007-02-14
Posts: 3

The Basics of Section/Category and setting up two level navigation.

Ok, I’m stuck. I know exactly what I want to do and I have a good idea of the tools to use, but I haven’t found a clear example of how to do this. What I am doing is trying to create a 2nd level navigation scheme using sections and categories (using the plugins, rss_unlimited_categories and cbs_category_list).
Basically what I’m stuck on is this. I have my sections as the first level of navigation. The rest will be categories, but do I need to create a category for every single section of the site, or where do they start becoming articles. Here’s what the site will look like.

Home
static article

Artists
Artist 1
Biography
News
Recordings
Press Kit
etc.
Artist 2
Bio..etc

Releases
Release 1
Artist
Purchase
Track Listing
etc
Release 2
etc

About
Staff Bios
Contact Us
News

Is it correct to make Categories of Artists and Releases and such with children categories of Artist 1, Artist 2, Release 1, Release 2 and then articles named Biography, Reocrdings, Track Listing, etc? (I’m thinking I don’t need the parent categories of Artists and Releases, but even if they are just organizing the other categories that’s fine)
I’m assuming that would allow me to also pull up all the news from the entire site under the news page and so on like that.
Also on a somewhat related question I would like the second level navigation be visible under the first level when you are in that section, is this possible? Are there any examples/tutorials out there on this subject?

Sorry about the newbie question, but as I’m learning this, it would be helpful to know if I’m on the right direction and not way off base. If there’s a better way to setup the structure, please let me know. Thanks!

Jon

Offline

#2 2007-02-21 20:00:10

joncrain
New Member
Registered: 2007-02-14
Posts: 3

Re: The Basics of Section/Category and setting up two level navigation.

Would I be better off not creating any sections and just using categories for navigation? I still cannot wrap my mind around this navigation thing.

Offline

#3 2007-02-21 20:30:05

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

Re: The Basics of Section/Category and setting up two level navigation.

Is it correct to make Categories of Artists and Releases and such with children categories of Artist 1, Artist 2, Release 1, Release 2 and then articles named Biography, Reocrdings, Track Listing, etc? (I’m thinking I don’t need the parent categories of Artists and Releases, but even if they are just organizing the other categories that’s fine)

It seems to me that this idea for organizing your site is the most logical thing to do. But you are going to encounter problems if you use ‘Biography’, ‘News’ etc. for article titles. With the default /section/title url scheme all Biographies would have the same url: /artists/biography. Which of course is not possible. You could forestall this by creating article titles like ‘Biography Artist 1’, and using a custom field or a second category to display the “title” Biography on the page. Maybe a category would be best, because that would also allow you to show article lists like for example ‘News’ for all artists.

Regarding the menu: I’m not familiar with the plugins you use, so I don’t know their possibilities/limitations when it comes to automated menus. Showing the second level navigation only on section or category pages must be possible using if_section and if_category. txp:if_different is a very nice conditional for this kind of lists, but there are problems if you want to use html list tags (because you can’t properly close them). If you don’t mind using <p> and/or <br /> it will work nicely.

Offline

#4 2007-02-22 15:51:07

joncrain
New Member
Registered: 2007-02-14
Posts: 3

Re: The Basics of Section/Category and setting up two level navigation.

At least I’m somewhat on the write track.

One more quick question about this setup. Is the following the correct way of doing it, and /or what is missing?

When someone clicks one of the sections or categories, I want them to come to an overview page. Some may have lists of categories, some may have lists of articles and some may have neither. Is it best to create an article for these overview sections or put the information into a form or on a page? I don’t want to create 500 different pages and forms, when I can use if/else statements, but I’m having trouble getting pages to display things right when I use if_section or if_category.

Thanks again.

jon

Offline

#5 2007-02-22 17:18:21

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

Re: The Basics of Section/Category and setting up two level navigation.

You can use sticky articles for that. Something like this:

<txp:if_section>
<txp:if_article_list>
<txp:article status="sticky" form="sticky-form" />
<txp:article limit="99" form="list-form" />
<txp:else />
<txp:article form="single-form" />
</txp:if_article_list>
</txp:if_section>

You can do something like that for category lists with if_category (you don’t need the if_individual_article there, because category pages are always article lists). If you assign the right section and category to your sticky articles, the right one will automatically be displayed.

Offline

Board footer

Powered by FluxBB