Hey,
Great module - Ive been using it for a while I found it off your blog I think, and when I found it as a real project I was stoked. However, there doesen't seem to be views support working for this field. Node reference allows you to create a view to determine which results appear in the reference field. This is good for adding pictures and theming the results in views, to allow for much more user friendly selections, and nodes based on permissions, access, arguments, etc.
However, when a un-recognized node is entered, I get an error: "this post can't be referenced."
I see a potential issue as because the nodes come in from views, there is no immediate way of 'knowing' what node type to create if the node isn't recognized, but the benefits of this would be huge. Is there a way around to get this done?
Thanks!
Comments
Comment #1
rc2020 commentedDoes anyone have any suggestions on this? Implementing views add and reference would greatly improve node reference selection.
Comment #2
yitznewton commentedI discovered a few things. Firstly, a new node is indeed created, but it is not referenced in the node being edited. It does work if the node reference content type is set to one setting, which is also included in the view - i.e. the view has no arguments or filters set. (I didn't test many other scenarios.) What doesn't work is to use views as one normally does, with filters and arguments; noderefcreate does not prompt the user for all the various values that determine whether it's going to be returned by the view's query.
So if the view is generic enough and it does return the new node, it will be added as a node reference; but if e.g. the view has a filter or argument set on, say, taxonomy, the new node will not have the correct value, will not be recognized by the CCK Node Reference validator, and will not be added to the node being edited. It will be created as an orphan node. I don't see a simple solution for this.
Comment #3
lastent commentedHi, I think that a good workflow could be like this:
- Some one try to add a reference.
- The reference is a new node.
- So it validates what kind of node is it referencing.
- Here there could be different scenes:
"It references more that one content type (more than one checkbox is checked)"
- It gets the checked content types
- It shows a form where you can select what kind of content type node will it create(maybe a modal window)
- The node is created.
"A view is set to get the items to be reference"
- It gets the content types that the returned nodes have.
- It shows a form where you can select what kind of content type node will it create(maybe a modal window)
- The node is created.
Hopes this can help.