Instant Website: how do I show titles

Re: [Jeffncou] Instant Website: how do I show titles

By (Deleted User) - January 18, 2012

Hi Jeffncou,

To add a title to an image being loaded by fancybox you just have to add the title to the anchor tag wrapped around the image tag:

<a href="<?php echo $upload['urlPath'] ?>" rel="photo_group" title="<?php echo htmlspecialchars($upload['info1']) ?>"><img ... /></a>

In the line above, the title is being set by the data from $upload['info1']. You could use text from any of the five 'info' fields supported, as long as you have set the field to be used in CMSB.

Fancybox will then take the title text and display it in the bar at the bottom of the photo.

For more tips on the different ways to use fancybox, check out http://fancybox.net/home.

Hope that helps!

Tom

Re: [Tom P] Instant Website: how do I show titles

By JeffC - January 19, 2012

Hi Tom P

I have the anchor tag wrapped around the image tag. But it is not working for me - i think there must be a setting within the js that needs to be amended.

Here is my code:<div id="photoGallery">
<?php foreach ($portfolioRecord['images'] as $upload): ?>
<div class="photo">
<a href="<?php echo $upload['urlPath'] ?>" rel="photo_group" title="<?php echo htmlspecialchars($upload['info1']) ?>"> <img src="<?php echo $upload['thumbUrlPath'] ?>" width="<?php echo $upload['thumbWidth'] ?>" height="<?php echo $upload['thumbHeight'] ?>" alt="<?php echo htmlspecialchars($upload['info2']) ?>" /></a>
</div>
<?php if (@++$count % 3 == 0) { echo '<br clear="all"/>'; } ?>
<?php endforeach ?>
</div>
<?php endif ?>

Visit your instant website demo site you can see what I mean: Click on the scrabble picture and it will load with fancybox without a caption (it will just say image 1/2).

What I would like to achieve can be seen here: http://fancybox.net/home. Click on the bottom left image of the girls jumping in front of a garage door. You will see that it says Image 1/3 Custom Title.

Thanks very much


Jeff

Re: [Jeffncou] Instant Website: how do I show titles

By Jason - January 19, 2012

Hi,

If you could fill out a [url http://www.interactivetools.com/support]2nd Level Support Request[/url] and point us towards the pictures that aren't working, we can take a quick look for you.

Thanks,
---------------------------------------------------
Jason Sauchuk - Project Manager
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/