Hello there,

I already posted my problem in a module development related forum topic:

http://drupal.org/node/172151

I want to realize contextual navigation via sidebar blocks. I have 3 content types which can be supplied with an external link (cck field). Now i want those links for each node to appear in blocks which ONLY appear if the relevant (full) node is showing.

I already managed to build a block that contains all of those field-type-links. But I am really not sure how to make them only appear in the appropriate situations.

I'd be glad if someone who knows views good enough could tell me:

1 - If that's actually possible using just CCK, Views and no additional modules
2 - How you would approach that problem ...

Thank you very much :)

Comments

nevets’s picture

This should do the trick, add the following argument to your view

  1. Add an argument for Node: nid
  2. Set 'Action to take if argument is not present' to 'Provide default argument'
  3. Set 'Default argument type' to 'Node ID from URL'
  4. Under 'Types:' select the appropriate type(s).

This will keep the block from showing on other pages.

mimhakkuh’s picture

... for the quick reply! I've followed the 4 Steps and now i have a sidebar block, which is displayed next to all full nodes. In most cases this block stays empty (just a headline) - if there is a context-link coming with the node, it is displayed.

That's very good - now i just need to make the block disappear on those nodes which do not carry contextual links.

I acutally suppose the only way to do this would be to mark those nodes with a dedicated taxonomy term (eg *dowlnoad* or *context*) and to define the display configuration of the context link's box (php) in a way it would only show up, when the special tag (see above) is provided with the node.

Then again, this approach might be a workaround too intricate ... does somenone know how to do this in a smarter way?

nevets’s picture

Re: "now i just need to make the block disappear on those nodes which do not carry contextual links"

It depends on what this means.

Step 4 above if you limit validation only to types with contextual link fields should help.

If you mean nodes with the fields but no actual links it sounds like you will need to do some custom theming.