Linking Carousel Thumbnails to Pages
Submitted by tforasiepi on 16 January 2013 - 12:38 AM
tforasiepi
Issue Timeline
I have been searching for a way to use the Pagelines Carousel's thumbnails to link to page, posts, or other URLs. I found a solution and wanted to post it here for future reference.
First, add the NextGen Gallery plugin. Then add the NextGEN Custom Fields plugin. Next, go to Gallery/Options and on the Effects tab set the JavaScript Thumbnail effect to "None".
Now, go to the NG Custom Fields and click on Gallery Custom Fields. Enter a Display Name and document it for future reference. We used "Link".
Next, create a Gallery and document its ID. Add your images and in the Link field enter a URL for each image to link to. Now in the Pagelines/Drag&Drop menu add the Pagelines Carousel to one of your Templates.
NOTE: The Carousel can be setup with Global settings and then refined on each page. For instance: You can use the Carousel ID as a global attribute in your Page Options or on individual pages. Set the Carousel Image/Link Mode to use the NextGen Gallery.
Once you have all of this setup, you will need to edit one line of code in the gallery-plcarousel.php file to get it to use the "Link" field instead of the image's URL. So locat the file under /wp-content/themes/pagelines/sections/carousel/gallery-plcarousel.php and be sure to make a BACKUP COPY FIRST. Now open the file and change line 23 from:
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
to:
<a href="<?php echo $image->ngg_custom_fields["Link"]; ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
Save the file and voila! The images in you Pagelines Carousel can now be linked to pages, posts, and other URLs.
Hope this helps others, if anyone has a better way... I am open to suggestions!
First, add the NextGen Gallery plugin. Then add the NextGEN Custom Fields plugin. Next, go to Gallery/Options and on the Effects tab set the JavaScript Thumbnail effect to "None".
Now, go to the NG Custom Fields and click on Gallery Custom Fields. Enter a Display Name and document it for future reference. We used "Link".
Next, create a Gallery and document its ID. Add your images and in the Link field enter a URL for each image to link to. Now in the Pagelines/Drag&Drop menu add the Pagelines Carousel to one of your Templates.
NOTE: The Carousel can be setup with Global settings and then refined on each page. For instance: You can use the Carousel ID as a global attribute in your Page Options or on individual pages. Set the Carousel Image/Link Mode to use the NextGen Gallery.
Once you have all of this setup, you will need to edit one line of code in the gallery-plcarousel.php file to get it to use the "Link" field instead of the image's URL. So locat the file under /wp-content/themes/pagelines/sections/carousel/gallery-plcarousel.php and be sure to make a BACKUP COPY FIRST. Now open the file and change line 23 from:
<a href="<?php echo $image->imageURL ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
to:
<a href="<?php echo $image->ngg_custom_fields["Link"]; ?>" title="<?php echo $image->description ?>" <?php echo $image->thumbcode ?> >
Save the file and voila! The images in you Pagelines Carousel can now be linked to pages, posts, and other URLs.
Hope this helps others, if anyone has a better way... I am open to suggestions!


