Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-03-29 04:09:20

fangonk
Member
Registered: 2007-07-12
Posts: 44

Category Descriptions

Can anyone think of a way to append a description to an article category so that it can be called from an archive or default page? Is there a plugin for this?

Offline

#2 2008-03-29 09:04:13

thebombsite
Archived Plugin Author
From: Exmouth, England
Registered: 2004-08-24
Posts: 3,251
Website

Re: Category Descriptions

Where did you want this description to appear?


Stuart

In a Time of Universal Deceit
Telling the Truth is Revolutionary.

Offline

#3 2008-03-30 03:11:45

fangonk
Member
Registered: 2007-07-12
Posts: 44

Re: Category Descriptions

I wanted the description to appear on top of a list of recent articles from each category. So I can’t just insert an article because, it needs to be different for each category.

Offline

#4 2008-03-30 07:31:34

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

Re: Category Descriptions

Would something like this do?

<div class="yourclass"><txp:if_category name="your-category">
<p>Your 1st category description</p>
<ul><txp:article_custom form="your-form" category="your-category" sortdir="desc" limit="10"/></ul>
</txp:if_category></div>

<div class="yourclass"><txp:if_category name="your-2ndcategory">
<p>Your 2nd category description</p>
<ul><txp:article_custom form="your-form" category="your-2ndcategory" sortdir="desc" limit="10"/></ul>
</txp:if_category></div>

etc

where your-form contains <li><txp:permlink><txp:title /></txp:permlink></li>


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

Online

#5 2008-03-30 10:24:39

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

Re: Category Descriptions

I’m using upm_category_image to associate an image to categories and use the caption field of the image as cat description. I found it works pretty well. I made some modification to the code to textilize the caption, so that I can use link and other formatting.

Z-

Last edited by Zanza (2008-03-30 17:54:13)

Offline

#6 2008-03-30 13:52:16

fangonk
Member
Registered: 2007-07-12
Posts: 44

Re: Category Descriptions

Those are both great suggestions, I’ll play with them and see which works better. This seems like something that might be a good addition to the next release. Having to hack an image plugin or manually update a ton of code, is a lot of work for something that seems like a pretty standard feature. Oh well.

Offline

#7 2008-03-30 17:51:14

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

Re: Category Descriptions

You could also use asy_wondertag, create a form for each category that holds the description, name it exactly like the category name, and call it on your page with

<txp:asy_wondertag>
     <txp:output_form form="<txp:category />" />
</txp:asy_wondertag>

Offline

#8 2008-03-30 23:23:04

fangonk
Member
Registered: 2007-07-12
Posts: 44

Re: Category Descriptions

Ahh, perfect. I like this.

Offline

Board footer

Powered by FluxBB