Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
Pages: 1
Category custom fields
Is there a plugin that allows me to specify custom fields for a category? (I need to attach a description and an image to particular categories.)
Offline
#2 2008-10-16 14:28:05
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Category custom fields
For images there is upm_category_image.
Offline
Re: Category custom fields
Thanks for the reply. What about a description for a category? Or just custom fields in general?
Although, I could use upm_category_image together with asy_wondertag and upm_image to use the description of the actual image itself. However, I am thinking that there must be another way to do this. (One that is easier for the client.)
Last edited by dl33 (2008-10-16 14:45:13)
Offline
#4 2008-10-16 15:03:02
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Category custom fields
Similar to your own solution is to use a form for the description with the same name as the category. Together with asy_wondertag you can use output_form to display the description.
Or maybe you can even use articles, use custom fields for the category name and image and display what you need with asy_wondertag and article_custom.
Last edited by els (2008-10-16 15:08:55)
Offline
Re: Category custom fields
mmh, that should work, but considering I probably want to prevent my client editing forms…
There is no way to simply add fields to the categories? I would even be up for hacking textpattern if someone tells me how…
Offline
#6 2008-10-16 15:58:57
- els
- Moderator
- From: The Netherlands
- Registered: 2004-06-06
- Posts: 7,458
Re: Category custom fields
You can always post a plugin request…
Offline
Re: Category custom fields
I needed something similar for a site I’m developing that indexes article information from a variety of publications— for each publichation (category), I needed to have category keywords and custom fields. Here’s what solved the problem for me:
- Create a section for category info. You can call it category info or something else. Mine was “publications.”
- Create an article for each category with the unique information and custom fields you need. Choose your category info section.
- There are several ways to link category info to individual articles associated with that category. This is what worked best for me, in the article form:
<txp:asy_wondertag><txp:article_custom section="category-info" category="<txp:category1 />" limit="1" form="_category-info" /></txp:asy_wondertag>
In Textpattern 4.0.7 (and the current dev version), you don’t need the asy_wondertag
plugin:
<txp:article_custom section="category-info" category='<txp:category1 />' limit="1" form="_category-info" />
Hope this helps. Many props and thanks to Zanza for getting me started on the right path
Offline
Pages: 1