开发者

Open form for node/add with taxonomy terms set, no user changes wanted

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 imp开发者_如何转开发ortant 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


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 :)


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


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


http://drupal.org/project/prepopulate

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜