Page 1 of 1
Adapt Slideshow bxSlider to use shadowbox when clicked
Posted: 30 Aug 2018, 09:12
by neillsun
Before I modify any code and create future headaches for myself when updating, I wanted to know if there is an existing way to change the behaviour of the bxslider module to display the image using shadowbox when a user clicks on it... I can only see how to change the link on the image. Currently this is set to No Link, but when clicking on the image it reloads the current page.
I'd prefer to have a zoomed-in version of the image displayed.
Thanks.
Re: Adapt Slideshow bxSlider to use shadowbox when clicked
Posted: 02 Sep 2018, 01:13
by Jan
Hi, the slider module does not include any method to display images in popup, it is just a link e.g. to category so this needs to be customized directly in the code
Jan
Re: Adapt Slideshow bxSlider to use shadowbox when clicked
Posted: 02 Sep 2018, 12:25
by neillsun
Jan wrote: 02 Sep 2018, 01:13
Hi, the slider module does not include any method to display images in popup, it is just a link e.g. to category so this needs to be customized directly in the code :idea:
Jan
Thanks Jan. this is what I ended up doing:
Code: Select all
//===============Modified code to turn Single Link into Shadowbox link=================
if ($single_link!='' || $single_link=='') { //i.e. ignore the value of this field
//$imageLink = PhocaGalleryFileThumbnail::getThumbnailName($v->filename, 'large');
$imageLink = PhocaGalleryFile::getFileOriginal($v->filename, 1);
//printf($imageLink);
//$urlLink = JURI::base(true).'/'.$imageLink->rel;
$urlLink=$imageLink;
$rel = 'shadowbox';
}
And added these lines with the rest:
Code: Select all
//Add Shadowbox functionality
$document->addScript(JURI::base(true).'/components/com_phocagallery/assets/shadowbox/shadowbox.js');
JHTML::stylesheet('components/com_phocagallery/assets/shadowbox/shadowbox.css' );
$document->addScriptDeclaration('
Shadowbox.init();
');
Re: Adapt Slideshow bxSlider to use shadowbox when clicked
Posted: 02 Sep 2018, 22:08
by Jan
Ok, thank you for the info.
Jan