3

I'm overriding the node add / edit form using panels. One of the fields that I have added is using the auto complete widget (it is a node reference field). I also want to add a link underneath the autocomplete field to add a new node (one of the referenced nodes). I'm wondering if there is a way to add this link.

If it's not possible within panels, perhaps it is possible someone can give me an idea of how to add this sort of link to node add form using templates.

2
  • There is a way to do this in a custom module, I just have not done so yet. I would try looking into panels codebase for the code that outputs the panel view you want to overide, and overide it in your module. You will have answers on this, I will have panels to overide myself in upcoming project so it`s a question I very well could have asked in upcoming weeks. Commented Jan 3, 2012 at 3:55
  • Looking into panels_node.module, on line 316, the function panels_node_hook_view, there may be an alter hook for that and you just change $node content in the alter hook. Or even simply override that hook yourself, and change $node`s content to add your links. There very well coud be other better options. Templates seems to be easier way to do this?... Commented Jan 3, 2012 at 4:10

2 Answers 2

2

The module your are looking for is References dialog.

Also, you can use contextual administration. It's a more general approach, that won't put the link exactly where you want, but is much more flexible on the other hand. It allows you to use the same rule set as Panels, such as "Selection rule: Node type", for example to node/add/[other-type]. Fits like a glove together with Panels.

1
  • I ran into this same issue. References dialog is brilliant. There's not much documentation for it yet but this issue did help me achieve this: drupal.org/node/1491576 Commented Apr 27, 2012 at 20:56
0

Thanks for the answers, not sure the question was really clear. I ended up doing it by adding "custom content" to the panels pane, I then just switched the options to html and made and html link to the other nodes add / edit page. I know this is not the most elegant solution, but it was really quick and easy.

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.