Closed (fixed)
Project:
Node access user reference
Version:
6.x-1.2
Component:
Documentation
Priority:
Normal
Category:
Support request
Assigned:
Unassigned
Reporter:
Created:
23 Nov 2008 at 15:52 UTC
Updated:
11 Dec 2008 at 00:44 UTC
I added a user reference field in one of my content types. I have another filefield in that content type which stores files for each node/content page. I would like to only show the files for that node/content page to users entered in the user reference list. I created a view with the previously mentioned filefield being displayed as a list, and argument is set to nid. How do I setup the view to only be displayed for users selected in the user reference list for that node/content page? Any guidance is appreciated. Thank you, Rani
Comments
Comment #1
danielb commentedIn your node template you check the current user's uid against the view reference field's data. If it matches you print out the file stuff, if not... then do nothing. Doesn't get any easier.
Comment #2
rmassamiri commentedThank you danielb. By any chance, would you mind sharing the php snippet for this that I can put in the node template? I am not a php coder. Thank you very much. -Rani
Comment #3
danielb commentedI'm not sure you even have to use this module? Files aren't nodes, and this is node access, not file access. But you could use an idea like this in your node-your_content_type.tpl.php template:
Comment #4
rmassamiri commentedThank you very much. I will give it a try.
Comment #5
danielb commented