Add title and description to dynamic thumbnail
Title and description to dynamic thumbnail
Question
How to add title and description to a dynamically created thumbnails in Animated Thumbnail Gallery?
Answer
To have title and description added to your dynamically created thumbs in Animated Thumbnail Gallery you need to set your Dreamweaver view to CODE and find your dynamic image. Should look something similar to:
<div id="dmxGenId_1" class="IndexGallery">
<?php do { ?>
<a href="images/<?php echo $row_Recordset1['filename']; ?>"><img src="<?php echo $row_Recordset1['path']; ?><?php echo $row_Recordset1['filename']; ?>" /></a>
</div>
<?php } while ($row_Recordset1 = mysql_fetch_assoc($Recordset1)); ?>
</div>
So now to add a description (I assume you have a description column in your database table, otherwise description will be one for all thumb generated) you need to add an alt tag to the link tag:
<a href="images/<?php echo $row_Recordset1['filename']; ?>" alt="<?php echo $row_Recordset1['description'];?>">
NOTE:
When adding a dynamic description make sure that all line breaks, white spaces etc. are removed in your DB record.
To add a title you should add title tag to the image tag (in this case I use image name for title):
<img src="<?php echo $row_Recordset1['path']; ?><?php echo $row_Recordset1['filename']; ?>" title="<?php echo $row_Recordset1['filename']; ?>" />
Save your page and preview it in your favorite browser.
NOTE:
This FAQ is relevant for ASP dynamic content as well. You need only to substitute PHP tags with their ASP equivalent.
Comments
Be the first to write a comment
You must me logged in to write a comment.