I'm doing work with extending taxonomy terms for special cases - as an offshoot of the EOL taxonomy sprint.
Here's a patch that assists in analyzing the state of a term object. For most uses the result will be trivial (terms are not complex objects) but when used in conjunction with the term enhancers
- taxonomy_enhancer
- taxonomy_image
- term_relation_types
- taxidermy
- taxonomy_xml
- and the nascent taxonomy_term_load (for core D7)
this information is very useful.
In any case, it fits with the functions already provided by devel.module
It:
Adds a "Dev View" Local tab to both the
admin/content/taxonomy/edit/term/%
taxonomy/term/%
pages, dumping (as usual) an object representation.
Example showing the result of a term with taxonomy_enhancer, taxonomy_image adding term data
3 things.
- we do not yet have a menu loader wildcard for terms, but catch's taxonomy_term_load() will serve that purpose soon. So there's an extra callback function to emulate it.
- Only the above mentioned modules so far actually do (or will soon) use the hook_taxonomy_term_load() that I'm invoking - but it's transparent until then, so it's looking ahead.
- It required a small bit of oddness in making the MENU_LOCAL_TASK show up on a menu that wasn't a container before, but it holds together.
.dan.
| Comment | File | Size | Author |
|---|---|---|---|
| #2 | devel-dev_load_for_term_objects-200801019b.patch | 2.81 KB | dman |
| devel-dev_load_for_term_objects-200801019a.patch | 2.3 KB | dman | |
| taxonomy_dev_load.png | 53.77 KB | dman |
Comments
Comment #1
dman commentedComment #2
dman commentedOK, a small update to the menu local item trick. For those that don't have edit_term (D6) already enabled (it's coming in D7).
Try this instead of the above.
PS. devel.module doesn't look good in coder.module review :-}
Comment #3
moshe weitzman commentedI like this in principal . I would think that existing menu items should be changed via hook_menu_alter() instead of hook_menu() .. .Do we need a check if taxonomy module is enabled?
Please feel free to submit a code style patch for devel. I'd love that.
Comment #4
dman commented1. OK, I hadn't seen hook_menu_alter used before. I'll see if it does the job. I know what I had to do was strange.
2. I imagine that if there are no taxonomy pages available, then
taxonomy/term/%won't do anything. I'll try a test.3. ... :-? Maybe.
Comment #5
moshe weitzman commentedAny update?
Comment #6
moshe weitzman commentedPatch would be great. D7 first.
Comment #7
moshe weitzman commentedthis was added a while ago