jquery slider

2 posts by 2 authors in: Forums > CMS Builder
Last Post: August 31, 2011   (RSS)

Re: [blind2uriz] jquery slider

By gkornbluth - August 31, 2011

Hi John,

You'll need a foreach loop for your images and in that loop why not use one of the info fields in the image upload for the text?

They are labeled "title" and "caption" by default in the upload field's "advanced options". Just delete the word "caption" and only a "title" will be asked for on upload. You can change the word "Title" to anything tat makes more sense for your label.

The code might look something like this:

At the top of your page:
<?php


// load viewer library
$libraryPath = 'cmsAdmin/lib/viewer_functions.php';
$dirsToCheck = array('/server_path_from_code_generator/','','../','../../','../../../');
foreach ($dirsToCheck as $dir) { if (@include_once("$dir$libraryPath")) { break; }}
if (!function_exists('getRecords')) { die("Couldn't load viewer library, check filepath in sourcecode."); }

// load records
list($your_slides_tableRecords, $your_slides_tableMetaData) = getRecords(array(
'tableName' => 'your_slides_table',
));

?>


and in the body for the s3slider:
<div id="s3slider">
<ul id="s3sliderContent">
<?php foreach ($your_slides_tableRecords as $record): ?>

<li class="s3sliderImage">
<img src="<?php echo $upload['urlPath'] ?>" />
<span><?php echo $upload['info1'] ?></span>
</li>
<?php endforeach ?>

<div class="clear s3sliderImage"></div>
</ul>
</div>


Hope that works for you,

Jerry Kornbluth
The first CMS Builder reference book is now available on-line!







Take advantage of a free 3 month trial subscription, only for CMSB users, at: http://www.thecmsbcookbook.com/trial.php