How do I receive the node's ID in the view when I use a panel?

hoyer - July 2, 2009 - 07:10
Project:Dynamic display block
Version:6.x-1.0-rc6
Component:Miscellaneous
Category:support request
Priority:normal
Assigned:Unassigned
Status:postponed (maintainer needs more info)
Issue tags:nid, node id, panel, views
Description

I followed the steps in the tutorial "How to create an Advanced slideshow with multiple imagefield images in a node" and got it working, but I want to display the node in a panel on my frontpage. Just the teaser, which is then the slide show without the article. Clicking on "Read More" button shall then deliver the whole content.

This fails, because in views, "return arg(1)" does not return anything if the node is displayed in a panel pane. So I need the node's id that called the dynamic display block.

I tried the following:

1. in the default argument code, I inserted "global $node;", but that was NULL
2. in the node template, I defined a new variable $node_id, but that wasn't available in the default argument code neither.

Any suggestions how to implement that? Thanks a lot!

#1

ppblaauw - July 2, 2009 - 07:54
Status:active» postponed (maintainer needs more info)

I tried to look at the panels issue queue and find something about giving arguments to views blocks. Found this issue Allow passing argument to block view on a page.

I don't know if it is possible with panels to give arguments to a block.

Which version of panels are you using?

The tutorial How to create an Advanced slideshow with multiple imagefield images in a node is more for creating a slideshow with a node and an imagefield with multiple images. Each node you will go to will show the slideshow with the images uploaded to that node. It has limitation because you can only use the title, alt and description text of the uploaded images.

If you make a 'normal' advanced dynamic display block slideshow, you don't need arguments for the node. The view would already select the nodes you want to show. (See Advanced slideshow tutorial and the Advanced slideshow video tutorial to create an advanced dynamic display block slideshow) You also don't have limitations in fields you can use in the slideshow.

If you place this block in a pane it should show the slideshow.

Hope this helps you further, please let me know.

#2

hoyer - July 3, 2009 - 13:51

It's panels version 6.x-3.0-beta2.

I actually thought of using the "normal" slide show, but it's not really what I need.
Our web site uses a format called "window", something like a topic-related gallery (less a news slide show), where we publish 4 or 5 photos each week with a continuous story. These galleries shall be archiveable. With the "normal" slide show the photos would be loose.

Plan B was:
I tried inserting the ddblock slideshow directly in the panel pane. But I'm just getting asked if I wanted to override the title of the block. I'm missing the opportunity for delivering an argument in the settings for the block.

Is there any possibility to define a global variable out of the node's template that then could be used in the view?

Thanks for your support!

#3

ppblaauw - July 4, 2009 - 00:19

I don't know what you mean we have a format: windows. Maybe you can explain more what you want to achieve, so I can help to find a solution.

With the normal slideshow it is easy to archive slides.

If you use a content type only to add slides to the slideshow, you would just filter on published to show the slides which are published in the slideshow. Other slides are still there (archived).

If you use a content type to show articles, you would use published for showing the articles on the Internet site. If you want to use some of these articles in the slideshow, you can add a cck field in the content type, e.g: show_in_slideshow. If you want to publish one of your nodes also in the slideshow you set show_in_slideshow. In the view for the slideshow you filter on published and show_in_slideshow. (also archiving the slides is possible here)

There are also option to use a nodereference to add slides to a node.

For the panels option with arguments I don't know if this is possible yet.

On the panels project page is says: "Panels 3 is in an early beta phase. Right now there are issues with the UI and bugs here and there, some of them dangerous." So not ready at all for production sites.

Hope this helps you further to use a 'normal' slideshow. Please let me know.

#4

hoyer - July 4, 2009 - 15:15

What I need is a bunch of slides that are combined to exactly one defined slide show (the node, then), similar to a picture gallery that is related to one event. Only the latest bunch of slides shall be showed.

Because of that, the solution mentioned before would be best practice, I think.

Whatever, the point is: the solution would simply be to define a globally valid variable in the node's template that delivers the node's id to the view!

I know, not beautiful, but that must do the job!

Isn't there any possibility?

Thank you for your efforts, ppblaauw!

 
 

Drupal is a registered trademark of Dries Buytaert.