1

Is it possible to modify a field on a node via a url string? For example, my node (1) has a field (field_stage) which I'd like to update using the following url:

www.mysite.com/node/1?field_stage=complete

I can't seem to find a lead on this. Any help is greatly appreciated.

1 Answer 1

1

There's the Prepopulate module

The Prepopulate module allows fields in most forms to be pre-populated from the $_REQUEST variable.

For example, the following URL,

http://www.example.com/node/add/blog?edit[title]=this is the title

will automatically fill the Title field on a new blog post with the words "this is the title". Any field can be prepopulated this way, including taxonomy and CCK fields. You can prepopulate more than one field at a time as well.

It's only in dev for Drupal 7 but I've used it in a couple of projects and I haven't had any major problems. If it doesn't quite match your use case you could always take a look at the code, it shouldn't be that tricky to adapt for other purposes.

1
  • Thanks for your reply. While this is a very handy module, I'm looking to modify an existing node, rather than pre-populating fields on a new node edit form. If it helps, my specific need is for a way to change the "status" field (custom field) of a node without having the user access the node edit page. Apr 1, 2013 at 19:54

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.