I'm setting up a web site that has different kinds of content (each of which uses a different template) all of which I would like to tag using one, single 'tags' template. (By tags, I'm referring to the category tags used on most blogs.)
Tagging, in itself, is working great:
I already found out how to set up and show blog post tags (thanks to this forum), and the method works nicely. (I.e., you link a 'tags.php' template with your 'blog.php' template via 'type='relation', and go from there.)
Therefore, I've successfully done these two things so far:
1. I set up a 'tags' template and linked it to the 'blog posts' template. This works and displays great. When a blog post is displayed on the site, all the category tags it belongs to are displayed under it. Also, if the site visitor clicks to see a list of all the category tags available, he can see them and click on any tag to see links to all the blog posts that belong to it.
2. I have now also linked the same 'tags' template to a different content type on the site, which is a 'book reviews' template. Doing this does successfully apply the tags to this separate template, because when I view a book review, the proper tags appear underneath it, just as they do for the blog posts.
But now is the hard part:
On a "Show All Tags" list page -- and also in the single-tag view, when I want to show the visitor a list of all items under a particular tag (blog posts and book reviews, in this case), I can't figure out how to incorporate 'blog posts' and 'book reviews' into a single, combined result.
EXAMPLE FOR CLARIFICATION:
This exists in the database:
Content Item - Categories (i.e., Tags)
blog post #1 - pets, events, stories
blog post #2 - events, shopping, sales
blog post #3 - sports, social life, gifts
book review #1 - events, biographies
book review #2 - fiction, sales, publishers
book review #3 - bestsellers, gifts, marketing
... But currently, I can only get my "Show All Tags" page to show this:
"Show All Tags" page:
-pets (1) [book reviews not included in this number]
-events (2) [book reviews not included in this number]
-sales (1) [book reviews not included in this number]
-gifts (1) [book reviews not included in this number]
Etc.
I can count and show all blog posts in the "Show All Tags" page or I can count and show all book reviews in it, but I can't figure out how to merge both into the same results set. Here's what I'm looking for instead of the above:
-pets (1) [one item from blog posts; book reviews has no item yet in this category]
-events (3) [two from blog posts and one from book reviews]
-sales (2) [one from blog posts and one from book reviews]
-gifts (2) [one from blog posts and one from book reviews]
Etc.
---
I know that <cms:pages> can only be used with one masterpage at a time. My guess is that I'd need to figure out how to set up a special SQL select statement and maybe use a variable or two, but I'm out of my depth in that regard.
Does anyone have any ideas?
Tagging, in itself, is working great:
I already found out how to set up and show blog post tags (thanks to this forum), and the method works nicely. (I.e., you link a 'tags.php' template with your 'blog.php' template via 'type='relation', and go from there.)
Therefore, I've successfully done these two things so far:
1. I set up a 'tags' template and linked it to the 'blog posts' template. This works and displays great. When a blog post is displayed on the site, all the category tags it belongs to are displayed under it. Also, if the site visitor clicks to see a list of all the category tags available, he can see them and click on any tag to see links to all the blog posts that belong to it.
2. I have now also linked the same 'tags' template to a different content type on the site, which is a 'book reviews' template. Doing this does successfully apply the tags to this separate template, because when I view a book review, the proper tags appear underneath it, just as they do for the blog posts.
But now is the hard part:
On a "Show All Tags" list page -- and also in the single-tag view, when I want to show the visitor a list of all items under a particular tag (blog posts and book reviews, in this case), I can't figure out how to incorporate 'blog posts' and 'book reviews' into a single, combined result.
EXAMPLE FOR CLARIFICATION:
This exists in the database:
Content Item - Categories (i.e., Tags)
blog post #1 - pets, events, stories
blog post #2 - events, shopping, sales
blog post #3 - sports, social life, gifts
book review #1 - events, biographies
book review #2 - fiction, sales, publishers
book review #3 - bestsellers, gifts, marketing
... But currently, I can only get my "Show All Tags" page to show this:
"Show All Tags" page:
-pets (1) [book reviews not included in this number]
-events (2) [book reviews not included in this number]
-sales (1) [book reviews not included in this number]
-gifts (1) [book reviews not included in this number]
Etc.
I can count and show all blog posts in the "Show All Tags" page or I can count and show all book reviews in it, but I can't figure out how to merge both into the same results set. Here's what I'm looking for instead of the above:
-pets (1) [one item from blog posts; book reviews has no item yet in this category]
-events (3) [two from blog posts and one from book reviews]
-sales (2) [one from blog posts and one from book reviews]
-gifts (2) [one from blog posts and one from book reviews]
Etc.
---
I know that <cms:pages> can only be used with one masterpage at a time. My guess is that I'd need to figure out how to set up a special SQL select statement and maybe use a variable or two, but I'm out of my depth in that regard.
Does anyone have any ideas?