Closed (fixed)
Project:
Taxonomy Menu
Version:
master
Component:
Code
Priority:
Normal
Category:
Feature request
Assigned:
Reporter:
Created:
1 Jul 2004 at 19:20 UTC
Updated:
16 Jan 2008 at 03:09 UTC
Jump to comment: Most recent file
taxonomy_menu is cool, but I like the way taxonomy_context shows you the description of the current term. I made a little change to the taxonomy_menu_page() function that presents the term description (as set up during taxonomy config, and allowed to contain HTML tags) as a message (appears just below the title at least in the themes I care about), just like taxonomy_context seems to.
I don't really know what I'm doing, just hacking away, but this seems like it might be of general interest.
function taxonomy_menu_page() {
if (arg(2)) {
$arguments = explode("/", $_GET["q"]);
$main_tid = check_query(array_pop($arguments));
}
else {
$main_tid = 0;
}
//PDS start
$term = taxonomy_get_term($main_tid);
if ($term->description) {
drupal_set_message($term->description,"term");
}
//PDS end
| Comment | File | Size | Author |
|---|---|---|---|
| #4 | tax_menu_description.patch | 3.58 KB | Eric Scouten |
| #2 | tax_menu_description_option.patch | 1.82 KB | Eric Scouten |
Comments
Comment #1
jonbob commentedThis won't go into the 4.4 version, but is a possibility for HEAD. Does this need to be an optional setting, or is it always safe to show the description?
Also, what is the right way to display the description? Using drupal_set_message() doesn't feel right here. Just a paragraph tag enclosing it?
Comment #2
Eric Scouten commentedSee attached patch. I needed this feature for one of my sites. :-)
This makes it an option with the default set to off (existing behavior). I put the description in a <div class="description">.
Comment #3
morbus iffI'll +1 this with the following caveats:
For the language revisions, perhaps:
Comment #4
Eric Scouten commentedNew patch that addresses Morbus' concerns.
Comment #5
Eric Scouten commentedSee also http://drupal.org/node/16055, which includes these changes and also adds an option to allow the listing of child terms.
Comment #6
Eric Scouten commentedThis patch has languished for months. Any hope of seeing it committed?
Comment #7
brmassa commented