Go to main content

Textpattern CMS support forum

You are not logged in. Register | Login | Help

#1 2008-12-29 14:14:03

galadan
New Member
Registered: 2008-12-28
Posts: 6

Tie category types together?

I’m creating a small client site using TXP and will use a separate TXP installation for each client. Categories for each client will be projects: Website Design, Quarterly Email Blast, 2009 Catalog, etc. Since there will be both news entries and files for download, each project gets an article category and a file category (ex. file category of Website Design and article category of Website Design).

My question: is there a way to tie in both types of categories so that when a client clicks on Website Design, he’ll get a list of both articles and files? I know I can tag a template with category lists for both, just wondered if there is a more elegant way to associate files with articles.

Hope this makes sense. :D

Offline

#2 2008-12-29 14:29:59

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Tie category types together?

Yes – you can use upm_file to place files within articles. You need upm_file and its companion upm_file_popper.

Offline

#3 2008-12-29 14:40:27

galadan
New Member
Registered: 2008-12-28
Posts: 6

Re: Tie category types together?

Excellent. I also just read an article about tags vs. categories that helped me figure out a solution to both this post and my other category post. If I use a parent tag of Web Design with child tags of Web Design File and Web Design Entry (or something like that), it should link files and articles together as well, yes?

Offline

#4 2008-12-29 14:46:13

jstubbs
Member
From: Hong Kong
Registered: 2004-12-13
Posts: 2,395
Website

Re: Tie category types together?

Well yes, but how you display the files depends if you want the file to be part of the article (in the body text) or just displaying in a sidebar. If its not part of the article, then you can use in-built TXP file tags.

Offline

#5 2008-12-29 15:18:24

Bloke
Developer
From: Leeds, UK
Registered: 2006-01-29
Posts: 11,453
Website GitHub

Re: Tie category types together?

galadan wrote:

If I use a parent tag of Web Design with child tags of Web Design File and Web Design Entry (or something like that), it should link files and articles together as well, yes?

Kind of, as Jonathan implies, it depends what you mean by “link”. The 4 types of category (file, link, image and article) are all separate so — without a plugin — the best way you can tie them together is to make the same categories in each of the lists and then use the various built-in category tags to manually imply they are linked.

The excellent tru_tags will allow you to tag articles, as you’ve found. The smd_tags plugin on the other hand allows you to assign tags (essentially unlimited categories that act like tags) to articles, images, files and links (optionally filtered by parent category).

Currently the 4 types of tag are treated separately, but with <txp:smd_related_tags /> you can easily link and filter them by applying logic such as “show me all the files that have the same tag as this article” or “show me all the articles that have the same category as the current file in this list”.

Plans are afoot in that plugin to offer a “global” tag that works across all 4 types, which makes the task of tagging even easier. Give me a day or two to get my head back in gear after I’ve finished this calendar plugin and I should have smd_tags up and running under TXP 4.0.7 and above.

Last edited by Bloke (2008-12-29 15:20:55)


The smd plugin menagerie — for when you need one more gribble of power from Textpattern. Bleeding-edge code available on GitHub.

Txp Builders – finely-crafted code, design and Txp

Offline

Board footer

Powered by FluxBB