Slideshow in header with slides coming from

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

Hi everyone,

I need to figure out how to build a slideshow that would appear in a region outside content, but take its images from the node on which it displays.

Make sense?

So from a user/admin perspective, I make a new article, and in its edit-mode I create multiple slides (eg. field collection with title, image, link etc) so that when I save it, the images appear in the header.

It seems simple in concept but I can't figure out how I set things up so it creates it on-the-fly...

Comments

more details

left's picture

*edit - I was in a rush and clicked save, thinking I could add more details later, but realised I'd posted instead. Anyhow...

I am going to look into this using Views (way more research needed in this dept). I'm hoping I can have a single Views block in whatever region and somehow restrict the Views content to display image fields associated with the active node ID or something like it...

The main goal is to allow the client control the slideshow content without going near blocks, and without the image being separate from the current node.

The reason I am doing this is to emulate an existing set up in another CMS, so I am open to alternatives, or criticisms on the value of doing it this way at all.

Thanks!

Contextual Filters

markconroy's picture

You need to create a view of type block of that content type, showing only the image field(s) that you want, displayed as a slideshow AND with a contextual filter (found under "Advanced") saying to restrict the images to those in the present URL.

The pop that block in the header.

No results behaviour

left's picture

Hi Mark,

Thanks for the help. That worked a treat. I've only tried it on static images so far however, so I may be back when I pursue the slideshow version.

To extend this, I wanted the block to display only if there is an image selected so this would allow me to enable the block to display on all pages, but it does not render if empty, leaving a big blank space. Adding a not-empty filter to the image fid did the trick.

Also, in case anyone else out there hasn't come across these yet:
http://nodeone.se/da/node/20
Really comprehensive vid tuts all about Views. This weekend it was me, multiple cups of tea, and non-stop videos. And I'm so much the wiser :)

Hide if empty

markconroy's picture

Off the top of my head, I reckon if the image field is the only one showing and you have the hide if empty check box checked, then the block won't show if it's empty.

I'd have to look in to it a bit more to verify though.

I was thinking the same Mark,

left's picture

I was thinking the same Mark, but it seems only the field is hidden if empty...So the block remains, but with no content. I'm getting all the html output down to the nested <div class="views-row..

Having said that, I thought what I'd done last night worked, but seeing it today I find out it didn't, so now I'm thoroughly confused :)

I'd need to set it up on a test site to see it properly - I can't guarantee my theme or my template overrides aren't affecting things as well.

Sometimes I wish there was a delete button

left's picture

I should retract my previous statement, but I'm not going to edit, as I don't want to misinform anyone. Plus, tracking my mistakes keeps me humble :)

Adding a "if not empty (NOT NULL)" filter for the correct field FID does work. The block is not rendered then. And everything is sweet.

Thanks for listening, world.

Just a quick tip, if you're

kaipee_s2s's picture

Just a quick tip, if you're stuck in the future you can try asking around in the IRC #drupal-uk.

I have only been using Drupal for around 3 months and they have helped me with a ridiciulous amount of things. Some very knowledgeable people in there

Ireland

Group notifications

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

Hot content this week