views:

259

answers:

3

Hi,

I use a hierarchical taxonomy with taxonomy menu and want to add to my view a simple link to the form for adding mynodetype "in this directory"=with this term lineage. (up to 4 terms)

outside of drupal one would put a hidden form field.... what would be a good and drupalish way to accomplish this ? Do i need an own .tpl.php ?

First I tried autopopulate, but it seems to behave not well with the hierarchical select ajax which is no surprise imo. Then i decided that this might be a feature i could add lateron, more important is just the fix assertion of terms to the node.

I use current drupal-6, cck, views. I tried a bit themeing yet and am quite familiar with php, but haven't done any module coding yet, but like to dive into it. Just btw fyi.

My goal is a DMS for my company, the documents arent changing very often, but we need fine grained permissions, so i decided for TAC and make the folder structure by taxonomy.

regards, florian

A: 

So there is nodes in this menu? or pure terms? If there is nodes, use Flag/Rules/Token modules - and make new rule if user flags node > create new node > populate new node cck taxonomy field > redirect user to node form > optionally hide taxonomy fields from node form... something like that.

If menu items are pure terms you may want to explore "taxonomy flags" and try first approach or in views insert term field, hide it from display and create new global field (or customfield module) and with php and text replacements create link ?q=node/add/[my node type]/[term id] and again with rules module catch a form being built and insert any value from URL views made, like arg(0) will be node (useless), arg(1) will be add (useless), arg(2) will be [my node type] and bingo! arg(3) will be [term id] (turn off clean urls for a moment there), feed these again to rules populate field when node form is being created. remember to configure cck [my node type] taxonomy field, something like "write whole inheritance" or something like that in node fields setup form.

I believe you can fine 3 more ways to do it... with Drupal :)

henrijs
Thx for this comprehensive advice! I've been diving into flags, rules, actions the following three days. Not yet finished though. Today i continue after weekend, just wanted to give a short reply. recalling... my issues are: The form element of core taxonomy has (here) NO element id (to enter in rules for form building). And so i cant hide it. Next: Can i still use the great taxonomy menu if user enters taxonomy id in a content taxonomy field?? Guess not!?If you have an idea for that henrijs, would be great. Otherwise - sooner or later i gonna find the 3 more ways :)
groovehunter
A: 

You could take all kinds of control over the node form with this... http://drupal.org/project/node_form_template

I'm sure there are several ways to do it. Here's a useful thread about the topic... http://drupal.org/node/40385

doublejosh
thx for your hint, not sure when i have time to try.
groovehunter
A: 

I guess the "Nodereference from URL" module will give you a headstart on how to implement the same functionality for Taxonomy. Please post the module back to the community, i would love to use this. http://drupal.org/project/nodereference_url

barraponto