By ghankstef on
How do I make a taxonomy "node" or page display on the term description and not nodes in the term?
The taxonomy context module lets you display the term on a a term "node" with a url like this:
http://localhost/drupal/taxonomy/term/21
But it displays all the nodes too that belong to that term. I don't want this behavior in most cases. Can I override this at the theme level or some other way?
Thanks
Comments
Try adding '/all'
Try adding '/all'
So: http://localhost/drupal/taxonomy/term/21/all.
The 'all' directs drupal to show everything that is in and under the term itself.
So, with this structure:
Food (21): milk(22):lowfat(25), whole(26), organic(27); eggs(23); catnip(24)
the above url should make all categories under 'food' visible, even if you have lowfat, whole, and organic milk as subcategories of milk. If you don't want the subcategories of milk, do this:
'taxonomy/term/21/1' (I think).
I found this at:
http://localhost/drupal/admin/help/taxonomy at the bottom of the page, the section entitled: "Displaying content organized by terms"
I hope this was what you are asking for...
Maria
Thanks for the tip
but it doesn't seem to have an effect - it shows the subcats and nodes whether I use:
http://localhost/drupal/taxonomy/term/21/all
http://localhost/drupal/taxonomy/term/21/0
http://localhost/drupal/taxonomy/term/21/1
Hmmm...at a loss. I looked
Hmmm...at a loss. I looked briefly at my settings, but generally want the subcategories visible, so i haven't tried limiting it. Also, I tend to do things like taxonomy/term/21+56/all, becuase I am creating urls to specific combinations. I will think about it a bit, but I am off to the coast for a week, limited web access. Sorry I can't add more....
maria
Turns out $help was was not such a big help in this case
The nodes and subterms for a term are displayed in php-template with the $help variable like so:
So removing this from my page.tpl.php file seems to have stopped showing all the sub-terms for a term, but it still shows a list of all nodes which is not what I want. I just want it to show a single node or the term description
Customizing display of taxonomy "pages"
It is possible in the phptemplate system to customize what a taxonomy or other "node" does and looks like
In you page.tpl.php file do this
the $arg array in this case is the first part of the url after your drupal section for example:
http://localhostdrupal/taxonomy/term/5
would evaluate to true in the above if statement ( if (arg(0)=="taxonomy") .
Now you are free to do whatever you want with taxonomy pages. It does seem there should be a better way to do this but it is the best I can do for now.
Also getting the taxonomy section just to show one node or a description and not sub-nodes and sub-terms is something I still have to figure out
Another way around
The way I've generally handled this is to make a page which belongs to each taxonomy with the description of the taxonomy and then it can be given a URL alias. There are downs and ups to doing this. The downside is that it's not kept with the taxonomy description in the taxonomy. The upside is that I can have people who don't have administer taxonomy permissions administer their individual pages and where I want I have the option of including PHP scripts to pull the titles or other information into the main page.
It seems that a Taxonomy Site Map might be a good module. I'd have to think some about whether it should be built from the taxonomy description or from a node in each taxonomy designated as the one to use for the site map.
--
you're the right, the current behaviour makes it almost useless
I want to categorize my site, and think the whole taxonomy system is quite a nice concept, except that, as the poster mentions, I want to be able to put in my own nodes for the "index" of a parent term. For example, suppose I have the following vocabulary:
Online Demos
- End User Demos
- Developer Demos
There will obviously be lots of nodes that belong to either End-User Demos or Developer Demos, but for the three terms listed above, I want to be able to create my own index pages. I have successfully done that, but the problem is that those terms render their own version of an index in the taxonomy system, but I want to use mine. For instance, if I have the taxonomy_context module on, I will get the correct breadcrumb, Home >> Online Demos >> Developer Demos if I'm viewing any of the developer demos .. but if the user clicks Online Demos, he gets the crummy taxonomy page that lists all the subterms in a very ugly way. I want to be able to use my index page for online demos, or at least be able to customize the built-in taxonomy listing so that I don't have to create my own index pages. There is no obvious way of doing this .. and it makes the whole taxonomy system useless in my eyes.
I also loved the idea of having a site menu automatically generated for me (via the sitemenu module), but what's the use, if the links in the site menu point to the default taxonomy views? I've been banging my head over this issue for days now, but can't seem to figure a way around it... I think I might have to just abandon the whole categorization via drupal's taxonomy system idea and do it manually.
like this?
http://beta.blkmtn.org/index.php?q=kb
I built the menu referencing page type node at the top and taxonomy terms for articles.
-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
yes exactly!
that's exactly what I'm looking for. Could you tell me how you went about doing that? More specifically, on the term pages you have the KB breadcrumb. How did you make that breadcrumb point back to your KB index, rather than the taxonomy page for it?
Thanks!
path module
kb is a page type node urlaliased to KB.
kb == node/6
THe others are taxonomies aliased to
kb/messaging == taxonomy/term/13
kb/scripting == taxonomy/term/15
If you set the path like that, then the bread crumbs work just fine.
-sp
---------
Drupal Best Practices Guide - My stuff Black Mountain
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
not working for me
That just isn't working for me. I am using drupal 4.6.3 with the taxonomy_context module installed. Please tell me what I am doing wrong in the following scenarios:
I have a top level vocab called: Content
Then I have a term called Solutions. Now, for that term "Solutions", I want to display my own node. But changing the path to "Solutions" does not do anything for the breadcrumb. When i'm on a page that is categorized under "Solutions", the breadcrumb displays "Home >> Solutions" and Solutions still links to taxonomy/xx rather than /Solutions.
also, in your set up, if you were to use the sitemenu module, what does your tree look like? Do you actually get KB at the top and the terms below .. all linking to the correct pages?
Michael
straight core
I missed the taxonomy_context module. I am using taxonomy, menu and path. Nothing else to accomplish that. The 'SIte' menu is a menu that I actvated in the blocks area. I do not know how the taxonomy_context module works/interacts with stuff.
Here's a screen shot of the setups.
http://www.blkmtn.org/index.php?q=node/223
http://www.blkmtn.org/index.php?q=node/224
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mount
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
it was the taxonomy context menu interferring
Hi Steven,
It was the taxonomy context module that was interferring and rewriting the breadcrumbs. I have successfully set up the same thing you have. It's good, but I realize now, that it's still not quite what I want .. but it's definitely a step in the right direction. I'll keep working at it ... thanks for your help!
Michael
no problem
If it helps, I believe that there are several updates in 4.7 that should address this issue better.
-sp
---------
Test site, always start with a test site.
Drupal Best Practices Guide -|- Black Mount
-Steven Peck
---------
Test site, always start with a test site.
Drupal Best Practices Guide
Have you looked at the php snippets in the handbooks?
I realize your question is over a month old, but since others are posting, I thought I'd offer up this perhaps helpful thought....
In the handbook, there are well over a dozen php snippets that you can use to dynamically pull content according to node type, taxonomy term, etc. You might be able to do something like that, and in effect create index nodes.
I'm a bit unclear on what you're trying to do, but these might help.
http://drupal.org/node/23220
Also, there is a contributed module to associate taxonomy dispay with a node. I've not tried it yet, but it might lead to some ideas.
http://drupal.org/node/19806
===
Laura
pingVision
_____ ____ ___ __ _ _
Laura Scott :: design » blog » tweet