Posted by mlncn on March 25, 2008 at 4:57pm
| Project: | Edit term |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | mlncn |
| Status: | needs review |
Issue Summary
Possible useful reference: http://drupal.org/node/174639
| Project: | Edit term |
| Version: | 5.x-1.0 |
| Component: | Code |
| Category: | bug report |
| Priority: | normal |
| Assigned: | mlncn |
| Status: | needs review |
Possible useful reference: http://drupal.org/node/174639
Comments
#1
We can fetch all vocabularies in use on a site with taxonomy_get_vocabularies, and then iterate through invoking the hook_term_path if it exists with a blank taxonomy term object.
Here is a typical term_path statement from the image module package:
<?phpfunction image_gallery_term_path($term) {
return 'image/tid/'. $term->tid;
}
?>
We can then parse the string to get the arguments, and create the "if (arg(0) == $path_part_1) etc. conditional entries for term_edit_menu (and perhaps block if that functionality is kept) dynamically. This would automatically create edit links for most, if not all, taxonomy-using modules that play by the rules.
Unfortunately, Drupal core's own forum module does not use the term_path hook that taxonomy invokes. Instead, forum provides no guidance for third-party modules and hard codes its own display in several places, for instance:
To be fair, forum also has special administration for forum-ified taxonomy terms, and taxonomy module provides no mechanism for providing these links at the moment. With edit_term merged into core, there would be a mechanism for edit links.
In short, a core version of edit_term would have to prove itself by replacing forum module's custom links.
A richer API for accessing taxonomy term view and edit paths (instead of the hack suggested here) would be nice and patches applied to both taxonomy and forum could show the way.
benjamin, Agaric Design Collective
#2
+1 for this. It will definitely improve usability.
I would not bother forum module as this issue http://drupal.org/node/197864 makes it compatible with hook_term_path.
#3
Sounds like a lot of work, and would I guess require core modifications to achieve this usefully in D5. Lets see what comes out of the D7 taxonomy improvements, and not try to do this in this module. It's a deep challenge - this module is cosmetic UI only.
#4
it wasn't a lot of work. I'd say it was an easy change. Why wait for D7 when you can have it in D5? If it's working correctly let's include it in D7 (without ugly faketerm).
I had this patch on my production site since 5x-1.0 and it was working like charm. Please check it.