Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
#1 2010-03-20 10:03:54
- Greenleon
- New Member
- Registered: 2010-03-20
- Posts: 2
Category descriptions
I am wondering if there is a way to file a description for a (file-)category, that is displayed when I open the category page (like domain.com/category/mycategory)
Maybe with a plugin? Would be useful.
Regards
Leon
Offline
Re: Category descriptions
A plugin would be handy but until we have one I can think of 2 work-arounds.
The first would be to use the category’s “title” field. This would give you a little room for a description though I have no idea how long the field is so probably be restricted to a short description plus you loose the ability to display a category title.
The second would be to create a form template consisting of blocks wrapped in <txp:if_category></txp:if_category>
tags then call the form to your page where you need the description. The only problem I see with this is if you have the same category names being used for different content-types as the tags don’t have a “type” attribute.
That attribute might be something worth adding to the base code as we are starting to improve image and file tags.
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#3 2010-03-20 12:09:03
- Greenleon
- New Member
- Registered: 2010-03-20
- Posts: 2
Re: Category descriptions
Okay. I was hoping there was another solution, though. Thank you.
I just noticed the <title> is not set correctly when visiting the category page of a file-category. Is that intended?
Offline
#4 2010-03-20 13:47:16
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Category descriptions
thebombsite wrote:
The second would be to create a form template consisting of blocks wrapped in
<txp:if_category></txp:if_category>
tags then call the form to your page where you need the description.
Can be simplified if you name the forms like the categories, for instance ‘descr_cat1’, ‘descr_cat2’ etcetera:
<txp:output_form form='descr_<txp:category />' />
The only problem I see with this is if you have the same category names being used for different content-types as the tags don’t have a “type” attribute.
That would make it even simpler, you can use a sticky article then.
Greenleon wrote:
I just noticed the <title> is not set correctly when visiting the category page of a file-category. Is that intended?
Hmm… you’re right, the page_title tag only seems to work for article categories. I suppose it’s intended, though maybe not the expected (or desired) behaviour. A workaround is to create an article category with the same name.
Offline
#5 2010-03-20 15:34:42
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Category descriptions
This may help, ras_if_category_type_v4.0.7.txt
Offline
Re: Category descriptions
Did you just make that Rick? What’s up? Hasn’t the snow gone yet? ;)
Stuart
In a Time of Universal Deceit
Telling the Truth is Revolutionary.
Offline
#7 2010-03-21 01:58:08
- rsilletti
- Moderator
- From: Spokane WA
- Registered: 2004-04-28
- Posts: 707
Re: Category descriptions
No, it was originally written in it’s current form in response to this need forum thread
Offline
Pages: 1