Jump to:
| Project: | Taxonomy VTN |
| Version: | 6.x-1.x-dev |
| Component: | Code |
| Category: | feature request |
| Priority: | normal |
| Assigned: | Unassigned |
| Status: | active |
Issue Summary
I'm using taxonomy_vtn module for an entry page to a wiki. When user clicks on a term, the list of nodes associated with the term are listed. When there are no nodes associated with the clicked term, currently a message 'No data to display. This term is probably not used by any node.' is displayed. Instead of showing this message I want it to redirect to a url path that will enable the user to create a new wiki node using. The url should pass parameters to pre-populate node title and a CCK content taxonomy field in the wiki form with the term's name. The prepopulate module handles the pre-population.
The feature request here is to add an option to set a url redirect from the module's admin settings page and enable the flexible creation of the urls of the form:
drupal_goto("node/add/wiki",array("edit[field_wiki_keywords][value]" => $term_obj->name,"edit[title]"=>$term_obj->name));
At the moment I have hacked your code and achieved what I want by adding the above line at the end of the:
elseif (!$no_errors) {
loop starting on line 1298 in taxonomy_vtn.pages.inc
Comments
#1
That sounds interesting, although the redirect is quite specialized here...
Did you create an admin screen to enter that info? Otherwise, a drupal_goto() has the side effect of not returning (since it is quite useless in that case.)
Could we instead add a hook for Rules and then users can use Rules to create the goto or whatever else they happen to feel like doing in this situation? (yell at the user, barf, drink a beer...)
As far as I know, supporting Rules isn't that hard (i.e. in that elseif block, call a module_invoke() and a little bit of code in file that offers that trigger in the Rules module.)
Thank you.
Alexis
#2
No I did not create any admin UI. If the drupal_goto doesn't return to the calling subroutine, then that may cause problem. But at the moment it seems to work fine.
Anyway I think a more robust solution necessary. I think your suggestion to support Rules is the best way to go. How soon can we have this feature?