view with multiple arguments not working - please help!

Events happening in the community are now at Drupal community events on www.drupal.org.
aprice42's picture

Hello,

I am having some trouble getting a Views 2 argument to return what I want.

I working with Drupal 6.19 and all modules are up-to-date.

I am using the content_profile module to make a profile node for each user (public_profiles). And each user can create various types of nodes, one of which is called a Location.

I setup a block view to return nodes that are Locations, and I am trying to make that block view appear on the users public_profile node...

I am able to get the block to show using a User:UID argument based on the 'user id from URL', but that shows the block on any node the user has created which is not optimal.

So to show the locations on only the users public_profile node I added a Node:type argument. Here is a screen capture of what I have so far: http://awesomescreenshot.com/0cdlgwdb

I have tried many variations of this but cannot get it to return the user's locations block to their public_profile node.

Can anyone out there offer some advice to get this working?

:) Andy

Comments

Block Visibility

eliza411's picture

Have you tried limiting the appearance of the block via the block's visibility settings instead of the view? You could place it to show only on pages with a particular URL pattern or use PHP something like what you have in the views argument.

Hi eliza411 :) thanks for the

aprice42's picture

Hi eliza411 :)

thanks for the quick response, I have tried to control its display from the block in a couple of ways, and still get the block showing on all nodes that the user has created...

here is the first way: http://pastebin.com/UKDKY7Fy
a simple check to see if it is a node->type public_profile

and the second way: http://pastebin.com/HKfyypeq
get the current node id from arg(1) and use that to load the public_profile of the node's author, then check to see if the current node path is the same as the public_profile path

I believe that I have to do it with php because the profile path is based on the pattern http://domain.com/user-name

Hi eliza411 :) thanks for the

aprice42's picture

Hi eliza411 :)

thanks for the quick response, I have tried to control its display from the block in a couple of ways, and still get the block showing on all nodes that the user has created...

here is the first way: http://pastebin.com/UKDKY7Fy
a simple check to see if it is a node->type public_profile

and the second way: http://pastebin.com/HKfyypeq
get the current node id from arg(1) and use that to load the public_profile of the node's author, then check to see if the current node path is the same as the public_profile path

I believe that I have to do it with php because the profile path is based on the pattern http://domain.com/user-name

d-oh! [slaps forehead]

aprice42's picture

ok... I forgot enclose the block php code in php tags

I got it to do what I want with this code http://pastebin.com/UKDKY7Fy wrapped in the php tags

very confusing, to go from views arguments that don't want the code to have php tags and blocks that do.

too many details sometimes :)

Have you tried using the

tom.camp's picture

Have you tried using the Context module? It gives you more control over where and when to display blocks and more.

http://drupal.org/project/context

When in doubt, go downhill.

Portland (Oregon)

Group notifications

This group offers an RSS feed. Or subscribe to these personalized, sitewide feeds: