Main
Index
Search
Posts
Who's
Online
Log
In

Home: Products: CMS Builder: Plugins & Add-ons:
Instant Website: how do I show titles

 

 


Jeffncou
User

Jan 18, 2012, 7:27 AM

Post #1 of 4 (705 views)
Shortcut
Instant Website: how do I show titles Can't Post

Hi,

I am using Instant Website with the fancybox plugin to display images. The default set up displays Image 1/2 etc, when clicking an image. I would like to add the title of the image.

I have looked at the fancybox website and it seems that this should be straightforward by changing the showtitle attribute from false to true but I have tried without success.

showtitle appears a number of times and I have tried to change each by trial and error. I wonder if anyone can help by telling me which file and which line needs to be changed.

Thanks


Tom P
User


Jan 18, 2012, 12:20 PM

Post #2 of 4 (697 views)
Shortcut
Re: [Jeffncou] Instant Website: how do I show titles [In reply to] Can't Post

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:


Code
<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


Jeffncou
User

Jan 19, 2012, 12:00 AM

Post #3 of 4 (693 views)
Shortcut
Re: [Tom P] Instant Website: how do I show titles [In reply to] Can't Post

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


Code



Jason
Staff / Moderator


Jan 19, 2012, 10:51 AM

Post #4 of 4 (670 views)
Shortcut
Re: [Jeffncou] Instant Website: how do I show titles [In reply to] Can't Post

Hi,

If you could fill out a 2nd Level Support Request and point us towards the pictures that aren't working, we can take a quick look for you.

Thanks,
---------------------------------------------------
Jason Sauchuk - Programmer 
interactivetools.com

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