How to add context-dependent content to the view's output?

Events happening in the community are now at Drupal community events on www.drupal.org.
Posted by kirilius on December 20, 2007 at 9:56pm

I have a view that displays (let's say) a grid (gallery) of pictures related to a given node X. This view has a parameter that's passed through the URL: http://mysite/node/$arg1/pictures. It works fine but I would like to be able to make a few changes to the output:

1) Change the title so that it says something like "Node X pictures", where Node X is the title of the node with ID that's passed through the parameter $arg1.

2) Add a link at the somewhere on the page that says "Start a slideshow". I have the slideshow view ready. Let's say it's URL is http://mysite/node/$arg1/slideshow

3) Add a link to page that will say "Add a new picture to node X". Again I have the URL for the picture-creation page http://mysite/node/$arg1/add_picture and

(2) and (3) are basically the same: I need to add a link and dynamically construct the URL passing the same parameter that's passed to the current view.

The final result should look something like this:

Node X pictures

Pic1 Pic2 Pic3
Pic4 Pic5 Pic6

Start a slideshow (link dependent on the $arg1)

Add a new picture (link dependent on the $arg1)

What is the best way of dynamically using the parameters' values to modify the view output based on that?

Thanks for your help!

Categories: ,

Comments

Also how can I change the

Posted by kirilius on December 21, 2007 at 4:51pm

Also how can I change the text of the "more"-link in a block-view? Let's say I want to change it to "Show more pictures" instead of the plain "more"?

Any help please? At least

Posted by kirilius on December 28, 2007 at 10:16pm

Any help please? At least can you give me a starting point and a general direction?

Panels 2 will help you

Posted by amitaibu on December 31, 2007 at 6:43pm
  1. Panels 2 will help you structure your sentences 'start slide from node %arg1'.
  2. Views bonous pack - has a grid option.
  3. Add a picture to node x - you can theme your link to include %arg1.

Thank you, Alright, I will

Posted by kirilius on December 31, 2007 at 10:22pm

Thank you,

Alright, I will try theming my view and add those links at the bottom (also using %arg1). How about adding some title text that includes data taken outside of the current view (parent node's name)?

Views Developers

Group organizers

Group notifications

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

AltStyle によって変換されたページ (->オリジナル) /