Erasing taxonomy without providing theme function! - needs extra option
NikLP - May 3, 2007 - 17:32
| Project: | Taxonomy context |
| Version: | 6.x-2.x-dev |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Jump to:
Description
The code as it stands I don't think dhould be this wau - there needs to be an extra option available to the admin to allow them to decide where to place the vocab list. Tacking it on to the end of content was great to start with, but now I need to add an extra block there, and I can't control the output of this module.
Around Line 236:
foreach ($vocabularies as $vocabulary) {
if ($vocabulary->terms = taxonomy_node_get_terms_by_vocabulary($node->nid, $vocabulary->vid)) {
$node->content['taxonomy_context_taxonomy']['#value'] .= theme('taxonomy_context_vocabulary_list', $vocabulary);
// above line adds vocab list to $content - this should be available as a block maybe?
}
}
$node->taxonomy = array(); // erases the original taxonomy variable (can't control this in theme any more!)I think there should be a(n) extra option(s) to allow for greater flexibility here:
1) stop the default behaviour above and offer this as a checkbox (leave taxonomy alone, or override with "in content" list)
2) make the taxonomy list available as a block
Thoughts, etc?

#1
No one is working on the 5.x branches.
#2
Nancy, can you just check whether this is still an issue in 6.x? I've only got this module installed on a basic site and don't want to mess around in case I break something! :)
#3
I can check if you give me a better idea of what to look for and where. My use of TC so far has been pretty basic (I didn't even realize that the overview page [taxonomy/vocabulary] was there until last weekend when I was doing something to the menu), that's why we need a lot more community testing of all its features. Maybe I should have spent some time with V1, but didn't.
That said,
$node->taxonomy = array();is really bad news, as I discovered some time go in Taxonomy Image, where I had done something similar and cause many people a lot of heartburn. If it needs to be gone at theme time, template_preprocess is a better implementation.#4
Yes, the code is still there. The setting for this is in the content type admin page.
#5
I added a weight setting that allows you to move the TC stuff above or below the content.
This is not a completely correct solution as other modules may need $node->taxonomy intact. But it will begin to address your request.
#6
Yeah I think this whole way of displaying the "block" is kinda broken. It's all well & good to display it in the node content, but the way things are going, this is not likely to be really useful for much longer - given the onset of more complex themes like Fusion and modules like Panels.
I'd probably like to see it simply removed and be left to a themer to organise a more sensible way to display the content.
#7
See also #597242: Remove node taxonomy display code.
I was making a change to the Quotes module to use node_view in a block and this option causes a weird problem: Since it checks to see if the current path is a node page, it would mess up the block display only on node pages; on any other page the display was correct. Since this function destroys the taxonomy information, standard hook_link and hook_link_alter implementations break.
I don't know if this code could be moved to hook_link or hook_link_alter, but I doubt it. I am going to look at doing that.
I am beginning to seriously believe that Nedjo's suggestion in that other issue is a better alternative.