Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2005-11-14 23:46:13

nasv
Member
Registered: 2005-11-14
Posts: 22

... choose to display articles of a specific category within a section

I am fully aware of the content vs. presentation model…
I have different sections for my home-studio site: default, news, studio, artists, about; I then have a set of categories that I want to use to organize the content for the section.

—This is my question (by way of example): a) Let’s say I went to my artists section (mydomain/Artists/), I want to be able to display a little synopsis of all my artists and then have links for Artsist1, Artist2, etc… (which correspond to categories I have – Artist1, Artist2, etc…)

b) I then want to be able to click on one of those links/categories (e.g. Artist1) and be able to display all the articles of category Artist1 within this section

I guess this is the way I want to organize my information (hierarchy). Can anyone please point me in the right direction to achieve this (a & b)?

Thank you very much,
~Nico

Offline

#2 2005-11-15 03:14:45

nasv
Member
Registered: 2005-11-14
Posts: 22

Re: ... choose to display articles of a specific category within a section

—to follow up with my original post, I’m realizing more the potential of using this tag: “The related_articles tag is a Single_Tag which is used to produce a list of permanent links to related articles by title.” The part of the documentation that I do not understand is: “Its context is page or column and it provides hyperlinked navigation by article list.”

— In relating to my previous example regarding my Artists section, I figured I could have a set of articles within category Artist1 titled “Bio”, “Songs”, etc… so that, I believe, would do what I would want; however, I’m confused as to how to used the “related_articles” tag and SET the current catetgory that I want its articles output for.

Please advise,
~Nico

Offline

#3 2005-11-15 05:07:31

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

Re: ... choose to display articles of a specific category within a section

post #1: Use conditional tags (look in the Alphabetical tag list in the manual). post #2: That means it is a tag that is used in a page, as opposed to a form (where, say a tag like permlink is a form tag, not a page tag)

Offline

#4 2005-11-15 05:12:18

nasv
Member
Registered: 2005-11-14
Posts: 22

Re: ... choose to display articles of a specific category within a section

—so the related_articles tag can’t be used inside of an article? I planned on having one main article within the section with links to the separate categories’ articles?
—also, I had seen the conditional tags, but I was wondering how to take advantage of them — how to have the user make a decision where an article is set, for example.

~Nico

Offline

#5 2005-11-15 05:21:25

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

Re: ... choose to display articles of a specific category within a section

The manual shows you how to use them, the conditional tags. Anything I could say would only be repeating. They can go into either a page or a form, but if I were you I’d practice using them in a page first.

related_articles goes into your page, and that’s it. It is “smart” and figures out which article to relate to.

Best way to learn/understand is to take a look at the examples in the manual, and try it out.

Offline

#6 2005-11-15 20:50:47

nasv
Member
Registered: 2005-11-14
Posts: 22

Re: ... choose to display articles of a specific category within a section

I understand what a form is and how to create and edit forms; I’m wondering if by using in a “page” that means you can also put ‘related_articles’ into an article (or does that just count as using the form the article is assigned to)?

Additionally, you mention that the related_articles tag is “smart”, but what I want to know is HOW it makes its decisions, what does it lookup to be able to detect the current category, for example. By understanding HOW related_articles works, I’d be able to better manipulate it.

I have been reviewing the documentation, but I found a lot of the examples to be used in a context other than what I’m trying to do, but if you have any other links I may have looked over, please keep bringing my attention to them.

Thank you for your patience and your time to help me out, I really appreciate it,
~Nico

Last edited by nasv (2005-11-15 20:51:58)

Offline

#7 2005-11-15 21:10:43

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

Re: ... choose to display articles of a specific category within a section

On an individual article page, it will lookup articles with a category matching either of the current article’s categories. If you’re using both categories, there is no way to determine which category caused the article to appear in the list.

Otherwise, nothing is returned.

It will also work from the article itself, but only on an individual article view; you can’t extend/modify its behaviour by doing so. I wouldn’t recommend it simply because that’s putting display logic where it shouldn’t be, so modifying it later would mean going through every single article you used it within.

By default it fetches up to 10 articles, which you can change. But you also can’t really modify the display of the list, just change the wraptag and wraptag class.

Offline

Board footer

Powered by FluxBB