I have 2 Content types called Schools and School News and i want to add a add News Button to those School pages, so editors can create a new post for this specific school. I thought about using relation module as i am using it already for other things.

Would it be possible to create such a button that adds a hidden field with the ID of the specific school into the news form? That way i could add this relation while saving the node. Is there any other way to get this kind of functionality with relation?


The Node Reference URL module works with the References module to accomplish this feature. When you add a node reference field, you can specify Reference From URL widget which will auto fill the field from a value in the URL. You can also specify (in the field settings) to display a link on the referenceable node.

In your case, you would create a node reference field on School News that references Shools. Just select the Reference From URL widget and configure as necessary.

There's an older lullabot video about creating image galleries in Drupal 6 that demonstrates how it works. The Drupal 7 version has the same features and works the same way.


Maybe this help you: Relation autoconnect

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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