Home » Topics » Pods 1.x » Featured Content Slider using Boolean field
Featured Content Slider using Boolean field
This topic contains 2 replies, has 2 voices, and was last updated by macnab 2 years, 6 months ago.
-
AuthorPosts
-
November 20, 2010 at 12:01 am #164704
Hello!
I’ve read some questions that come close, but I’m still having some trouble with this one.
I am creating an Events system for a site and would like the user to have the option to click on a "Featured?" button that would tell a slider on the homepage to add the event to a short list of sliding (or fading) banners. I have figured out how to call the images I’ve marked as "featured", but I can’t figure how to integrate them into a slideshow script.
I know it should be done using jQuery or something similar, and I like the Nivo Slider so far: http://nivo.dev7studios.com/#usage
To complicate matters, I’m creating the site using a Child Theme in the Thematic framework. Sorry! But I think that I’ve loaded the scripts right.
My problem is basically that I can’t figure out how to take the featured images and use them with the script, which calls for multiple image src’s to work. This particular script (Nivo) turns the img src’s into a div with a background image of the src, which is cool. And currently when I run things, the first image Pods calls gets the Nivo treatment. But the other three or four images are ignored (and visible), which means that I’m not doing something right.
My code for the below to happen:
12345$event = new Pod('events');$sqltxt = 't.featured = "1"';$event->findRecords('id ASC', 4, $sqltxt);$total_events = $event->getTotalRows();and then
the Template in question:
1<div id="slider"><a href="{@slug}"><img src="{@photo.guid}" alt="{@name}" /></a></div>and the result:

I know this is a lot to throw out, and I’m grateful for help, in advance!
Matt
November 20, 2010 at 1:43 pm #164705With the code you’ve got, you’ll be wrapping each of the images in a div instead of having one div with three images in it.
Change your page code to this:
123<div id="slider"><?php echo $event->showTemplate('home_featured_slideshow'); ?></div>and your template code to this:
November 22, 2010 at 5:31 pm #164706Thanks, Chris. That is definitely closer, as far as the template code goes; the slider works a little better. I’m still getting three images on top of each other, though. I found something in the Nivo Slider usage guide that says that any other HTML besides
or tags will kill the slider. So…hmmm. Maybe I have to find another Slider that would work with Pods? -
AuthorPosts
You must be logged in to reply to this topic.