I'd like to make a link to /node/add/type, so regular users can easily add content of that type, but I'd like to also pass along a default value for the taxonomy term field, so that the new node will belong to the same term the user just came from, without the user having to worry about it. Is there some parameter I can add to the link to accomplish this?

Comments

jefgodesky’s picture

With the Prepopulate module (and the most recent patch to port it to Drupal 7), I was able to set up a link to

node/add/TYPE?edit=field_TERM[und][value]=ID

Where

  • TYPE is the name of your content type
  • TERM is the name of your taxonomy field
  • ID is the numerical ID of the taxonomy term you want to use.

Assuming that your taxonomy is in a select list. The link might look a little different if you have that field set up differently.

jefgodesky’s picture

I'm sorry, that's incorrect; it should be:

/node/add/TYPE?edit[field_TERM][und][value]=ID