I noticed that the ShortcodeCarousel plugin pulls the “square_thumbnail” as a default. I’d like to set an option, available through the shortcode, that lets users opt to pull other item types (original, fullsize, thumbnail, square_thumbnail). I am able to get the plugin to pull only fullsize or only square_thumbnails, but am struggling with how to introduce the choice. Here’s what I have so far:
In ShortcodeCarouselPlugin.php I’ve added:
if (isset($args['image_type'])) { $params['image_type'] = $args['image_type']; }
I think I probably also need to set something in the configs area, but everything I’ve tried has broken the page or not had any effect.
In carousel.php I’ve added:
`<?php if(isset($args['carousel']['image_type'])) {
$image_type = $args['image_type'];
echo link_to_item(
item_image($image_type, array(), 0, $item),
array('class' => 'shortcode-carousel-image'), 'show', $item
);
}
else {
echo link_to_item(
item_image('square_thumbnail', array(), 0, $item),
array('class' => 'shortcode-carousel-image'), 'show', $item
);
}
?>`
In my index.php file (since this will appear on my home page), I’ve added:
<?php echo $this->shortcodes('[featured_carousel showtitles=true speed=slow image_type=fullsize]'); ?>
Basically, I want to be able to pass the value of “image_type” into the place in carousel.php that currently has ‘square_thumbnail’ as a static option. But I don’t quite get how to access those values (let alone validate them!). Any pointers would be greatly appreciated! I’m still getting my feet wet with PHP.