By dhaven on
Hi, I've been playing around with the views module, multiblock and views api to try and get users to see the author of a node's other nodes in a block. eg if i view user/1's profile I would be presented with a block of that users stories.
Can someone point me in the right direction?
thanks
D
Comments
You can do this with the
You can do this with the views module. Blocks require php code in order to properly use arguments. Make a block view with the format and/or fields you wish, add an argument of "User: uid", then select "Provide default argument" and "PHP Code", and paste this into the code box:
This is untested-- but should be close.
===
"Give a man a fish and you feed him for a day. Teach a man to fish and you feed him for a lifetime." - Lao Tzu
"God helps those who help themselves." - Ben Franklin
"Search is your best friend." - Worldfallz
The key is you need an
The key is you need an argument on "User: uid". For a block view make sure "Action to take if argument is not present:" is set to "Provide default argument" and "Default argument type:" to "User ID from URL". This will make a view that when visiting a page of the form user/{uid} lists all content authored by that user. You can set style add filters etc as needed.
Thank you both. I have
Thank you both. I have found the argument 'UID is Author' in views but it still shows nodes from all users. Using argument api I have added 'user: UID is Author' but still no joy.
Where is the 'default argument' option? in views? or where is "Action to take if argument is not present:" is set to "Provide default argument"?
thanks
D
Take a look at the tracker
Take a look at the tracker view it uses "User: uid" not "Uid is Author". When you add the argument "User: uid" (or edit) the add/edit section will have 'Action to take if argument is not present'.
thanks to you both, works
thanks to you both, works well! now i need to show the relevant author in the heading its not %user is it?