Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2007-07-06 11:37:13

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Grouping articles together with common description

Hi everyone

I need a bit of help trying to sort out the best way to structure a site I am working on.

The site is for a publisher, who wants to have an online catalogue of their books. Each book can be in one or more categories (eg religious, novelty, children’s, etc), which is obviously easy to achieve (using rss_unlimited_categories). What is more confusing for me at the moment, is that there are a number of book series, each containing several books, so I need a way to say which books are in a particular series. Obviously I could accomplish this by using a custom field to determine which series a book is in, or by using keywords, which would mean that I could easily show links to other books in the same series.

However, as well as each book having their own description, each distinct series also has a general series description that should be shown with each book in that series. So I need a way to store this series description once for each series, but to display it with the entry for each book in the series. Any ideas? I don’t want to use a custom field for it, as I would have to enter the description for each book in the series, which would mean updating the description would be a nightmare!

I thought about using a new article for each series and somehow pulling the description in based on the value of the keyword (or custom field) in the individual book entry, but is this even possible (outputting the content of one article in another article’s individual page)? It sounds impossible as it would mean nesting article forms and multiple database queries and confusion all round!

Any ideas/thoughts gratefully received!

Thanks

Steve

Offline

#2 2007-07-06 12:40:10

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Grouping articles together with common description

However, as well as each book having their own description, each distinct series also has a general series description that should be shown with each book in that series. So I need a way to store this series description once for each series, but to display it with the entry for each book in the series. Any ideas? I don’t want to use a custom field for it, as I would have to enter the description for each book in the series, which would mean updating the description would be a nightmare!

Maybe you could use sticky articles ‘embedded’ in within the posts

something like

<txp:if_article_category name="series_1"><txp:article_custom status="sticky" form="body" id="40" /></txp:if_article_category>

where the form=“body” contains <txp:body />

The problem with this method is that your client will not have control over adding a new series..


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

#3 2007-07-06 13:35:39

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: Grouping articles together with common description

colak wrote:

Maybe you could use sticky articles ‘embedded’ in within the posts

something like

<txp:if_article_category name="series_1"><txp:article_custom status="sticky" form="body" id="40" /></txp:if_article_category>

where the form=“body” contains <txp:body />

The problem with this method is that your client will not have control over adding a new series..

Hey, I like it! I work very closely with this client anyway and they are particularly untechnical, so it’s probably not too much of a problem. Also, they won’t be adding new series that often.

So, just to confirm, the article with id 40 in your example is the one that contains the description of the series, and the series is indicated by a category for each series.

The only problem I can see with this is that producing a list of book categories would also include the names of the series too, which I would want to avoid. Ideally the list of categories should not include the series, as books within a series can be from any number of categories. I don’t really want to mix categories and series like this. Is there a way of creating a category list, but excluding those that start with a certain prefix for example? Then I could use your idea, but still keep an automatically generated list of just subject categories for the navigation.

Offline

#4 2007-07-06 17:23:37

Zanza
Plugin Author
Registered: 2005-08-18
Posts: 699
Website

Re: Grouping articles together with common description

You should use parent categories (i.e. “category” and “series” could be parent of the relative categories) and display only children of one of them.

You may also use rss_unlimited_categories tag for one type of cat (i.e., multiple categories), and category1 tags for series.

It should be easy, if I correctly understand.

Z-

Offline

#5 2007-07-06 17:40:56

springworks
Member
Registered: 2005-01-06
Posts: 172
Website

Re: Grouping articles together with common description

Zanza wrote:

You should use parent categories (i.e. “category” and “series” could be parent of the relative categories) and display only children of one of them.

You may also use rss_unlimited_categories tag for one type of cat (i.e., multiple categories), and category1 tags for series.

It should be easy, if I correctly understand.

Z-

Ahh! Now I’ve looked into it more closely, that sounds good. I didn’t realise at first that rss_unlimited_categories added an additional category listing to the existing TXP category1 and category2 tags.

Thanks!

Steve

Offline

#6 2007-07-07 07:13:52

colak
Admin
From: Cyprus
Registered: 2004-11-20
Posts: 9,090
Website GitHub Mastodon Twitter

Re: Grouping articles together with common description

springworks wrote:

Hey, I like it! I work very closely with this client anyway and they are particularly untechnical, so it’s probably not too much of a problem. Also, they won’t be adding new series that often.

So, just to confirm, the article with id 40 in your example is the one that contains the description of the series, and the series is indicated by a category for each series.

yes the id 40 is the description of the series…
to make the code clearer

<txp:if_article_section name="series_1"><txp:article_custom status="sticky" form="body" id="40" /></txp:if_article_section> //series description
<txp:article limit=10 /> // article content

Place the above anywhere in your layout.

The only problem I can see with this is that producing a list of book categories would also include the names of the series too, which I would want to avoid. Ideally the list of categories should not include the series, as books within a series can be from any number of categories. I don’t really want to mix categories and series like this. Is there a way of creating a category list, but excluding those that start with a certain prefix for example? Then I could use your idea, but still keep an automatically generated list of just subject categories for the navigation.

I changed the code above to use if_article_section in that way you could use categories for general navigation without having to worry.


Yiannis
——————————
NeMe | hblack.art | EMAP | A Sea change | Toolkit of Care
I do my best editing after I click on the submit button.

Offline

Board footer

Powered by FluxBB