Closed (works as designed)
Project:
View reference
Version:
6.x-2.13
Component:
User interface
Priority:
Normal
Category:
Feature request
Assigned:
Unassigned
Reporter:
Created:
17 Apr 2009 at 03:24 UTC
Updated:
16 Aug 2009 at 10:09 UTC
Hi,
When we use default value in view reference field configuration sometimes we dont want users to change it.
Currently, default value is just the first values of view and its arguments in node edit form. And users may change it when inputing a node.
Could you add an option that disable or hide view reference field group in node edit form. It could be more flexible for us.
Regards and thank you.
Nguyen Quoc Viet
Comments
Comment #1
danielb commentedI dont' think this is an appropriate feature for the scope of this module. I haven't seen it in node reference or user reference, and it would really be a more general feature that should apply across more CCK fields. Personally I think it it sounds like using a CCK field for this is not even suitable for your use case if you don't want this setting to be content managed.
Comment #2
t4him commentedThats interesting. I was looking for this exact type of functionality.
use case:
equipment - content type - "parent"
part: content type - node referenced in equipment - "child"
I created a view that generates every part assoicated with the selected equipment.
In the equipment "parent" content type I added a views reference to the above mentioned view.
I selected the above mentioned view as the default.
When the "equipment" node type is saved the view will display every part associated with it at the bottom of the node. I added a link in the header of the view to add a new part and I added a link in the empty text that indicates no parts exist for this equipment add a new part now.
* * * * * H E R E' S W H E R E I T W O U L D B E H E L P F U L * * * * *
Now when a new node "equipment" is created, the option to select the "default" view or "none" is available in the views reference drop down select box.
The default view is the "only view" written for this scenario but the user "could" select none. If that field was not displayed at all on the form, then the workflow would be perfect.
I did find this post that explains the use of of hook_form_alter and hook_form_FORM_ID_alter but I have strived to keep drupal "stock" to ease the upgrade process.
So this may point back to your original statement that this request may be specific to cck and not views reference.
Your comment and suggestions would be greatly appreciated. Thanks for listening.
Tim "t4him" Moyers
Comment #3
danielb commentedIt seems to me you have a few choices
1) Trust your node authors!
2) Hardcode the View or some PHP to generate the parts-list into the node template (would be my preference, since you obviously don't want humans to make decisions about this, which is the essence of a CCK field)
3) Use the 'content permissions' module to prevent everyone but you from changing 'view reference' fields.
You can't be giving your users features like View Reference if you're scared of what they might do with it.
Comment #4
t4him commentedOK,
A little late on the reply, but . . .
I created the views and the references . . .
I set the permissions for view and edit and . . . . Wha-La!
Now I have the view references that do not appear on the node/edit page but the view DOES appear at the bottom of the node view. The key was to use the permissions page for access control during edit and to use the views2 "empty text" field to put the hyperlink "Add a new part" . After a new part is added it appears in a table view under the equipment.
This thing is really taking shape now. I still have some "cleaning up" to do but it is all stock drupal and stock modules which makes it very reliable and easy to maintain.
Thanks for the reminder on the permissions page thing. Sometime you do just forget the most simplest of things.