I created a Gallery content type and and Image content type.....the image has a node reference to associate it to a particular gallery......I am using a view to populate the nodes available to reference to. This works great. I am requiring this field to be set when the user creates a node but I don't want to let them choose "none" which is the default option. Is there a way to get rid of the "none" option and only have nodes in the list?
This would make it impossible to create an image node not associated with a gallery. And even better would be that if no nodes meet the conditions of the filters in the view, and the select list has no options then a link to add a gallery would be there. Not in the select list but immediately under it....
Any ideas anyone?
Comments
Comment #1
quicksketchI think you can do this by both setting a default value and making the field required. However since Node Reference URL disables the option to set a default (since it pulls it from the URL), this isn't an option. You could set the fallback to "Page not found", in which case it's impossible to create an image without specifying a gallery anyway.
Comment #2
markusa commentedThe field is required already.....
How do I set a default value for a node reference? I looked at the settings and don't see a field for that....
A good default value would be the gallery node that is currently being viewed....
I still think it would be cool if the none option was gone.....I guess I can edit the module code myself to remove that option somehow....but I'd like to keep it stock if I could....esp since I don't know what code to remove
Comment #3
markusa commentedIs there a hook function that I can to override? This way I could remove the none option, or if there are no options because of the filters in the view that populates the select list, provide a link below the select list to create gallery....or redirect to a create gallery page
Comment #4
quicksketchLet's merge this with #742074: Remove the "None" option from the fallback select list