I was drawn to Drupal because I could see the tremendous potential of using taxonomy terms to affect the way a page looks, as well as what features might appear in it. However, I'm having trouble grasping how to make full use of this and I'm hoping someone can steer me in the right direction.
I'm familiar with the concept of parent>child, but I don't understand how to work within the hierarchy.
Let's say I have several layers of terms. For example, a term "bulldog" is a child of "dogs," which is a child of "mammals," which is a child of "animals." So we have this: animals>mammals>dogs>bulldogs.
I can conceive of several instances when I'd want to make my pages appear differently or have different blocks based on levels of that hierarchy.
For example, I might want to use a different CSS for "mammals" than what I'd use for "insects." But that CSS needs to apply to all children of "mammals" as well, such as "dogs," "cats," "pigs," etc.
And by the same token, I might want to have links to pages about dogs only appear on all pages created with different children of "dogs."
So here's where I have trouble understanding: When I create content about, say, bulldogs, do I have select the terms "animals," "mammals," "dogs," and "bulldogs," or is there a way to set it up so that if I select "bulldogs," the parent terms can be assumed? If it's a bulldog, it must be a mammal, so can the CSS for mammals be automatically used without me telling Drupal my page is also about mammals?
Related to this, let's say I've created a block that appears only on pages about dogs, but that includes the child terms of "dog."
I'd like to be able to use some kind of code (PHP?) to assign the block to all child terms. So rather than listing all terms, like "taxonomy/term/1," "taxonomy/term/2," "taxonomy/term/8," I can tell Drupal that any child of dogs will use this block. That way, if later I create a new child of "dog" I don't have to go back and add the new term to the list of assignments for the block.
I hope I'm making sense of this.
Please share your wisdom on this, because as hard as I try I can't seem to find documentation that clarifies it for me.
Comments
follow up
At http://drupal.org/node/58451 ridepo asks a similar question and does so more succinctly than I did. It appears, though, the replies don't answer my question.
Anyone want to take another shot at it?
Different CSS for different terms
To do that you'll either need to add some smarts to your theme for that (ie coding), or try out the taxonomy_theme module to see if it does what you want.
--
Anton
New to Drupal? | Forum posting tips | Troubleshooting FAQ
Example Knowledge Base built using Drupal
taxonomy_module
I'll look at the taxonomy_theme module. Thanks.
I'm only on the ground floor with PHP, so your other suggestion is the less desireable!
nope
After installing the taxonomy_theme module I can see some possible uses of that, but it's not an efficient way for me to accomplish what I want to do. I'd like to have dozens of taxonomy terms. The taxonomy_theme module requires a whole new theme for each modification of content by term.
I may want to change just a header or add a block for content using a particular term. Copying a theme just to make slight changes like this seems like the wrong way to go.
I'm back to thinking this is going to have to be handled differently. As I pointed out in http://drupal.org/node/58451, it's probably best to use some PHP code in the blocks module where it says "Show if the following PHP code returns TRUE (PHP-mode, experts only)." Unfortunately, I don't know what that code should be.
There may also be a solution here: http://drupal.org/node/46027. Again, that depends on if I can get this to work for all children of a parent term.
This may help too
This question is asked alot and answered with various methods. That is the Power of Drupal. It can meet most any situation. Here is another. It might not be specific but may help 'clear the fog'.
hope this helps,
t4him
--*--
post back with solutions
That's what I'm talking about!
This works: http://drupal.org/node/56441#comment-106917