Another custom gallery question

4 posts by 2 authors in: Forums > CMS Builder
Last Post: May 15, 2013   (RSS)

By meg - May 13, 2013

I'm creating another custom gallery for a different client. Essentially, I need to have an numeric value associated with images (sequentially in an uploads section) in an individual listing page to create a link that automates previous and next buttons. (I would just use the previous and next buttons from the gallery javascript, but they're already being used elsewhere on the page and can't be duplicated. My client wants redundancy.)

The link I'm trying to achieve is such:

javascript:featuredcontentslider.jumpTo('article', 1)

The number at the end is what I need to change based on the image previous and next in the upload section in the CMS.

Here is the full script for the image so you see what I mean. I tried using a index-1, index+1 but I don't have a record to associate it with. I would appreciate your help with this - thank you!

<?php foreach ($articlesRecord['images'] as $index => $upload): ?>
<!-- GALLERY IMAGE--><div class="contentdiv">

<!-- LEFT ARROW --><div class="arrow-left"><a href="javascript:featuredcontentslider.jumpTo('article', 1)"><img src="images/arrow-left.png" width="11" height="14" alt="&lt;" /></a></div>

<!-- IMAGE --><div class="article-image" style="background: url(<?php echo $upload['urlPath'] ?>) top left no-repeat;"></div>

<!-- RIGHT ARROW --><div class="arrow-right"><a href="javascript:featuredcontentslider.jumpTo('article', 2)" class="next"><img src="images/arrow-right.png" width="11" height="14" alt="&gt;" /></a></div>

</div><!-- END GALLERY IMAGE -->
<?php endforeach ?>

By meg - May 14, 2013

The is one entry in a multi-listing section, with one upload record where multiple images are uploaded. I need to designate a numeric system (based on order) of these image uploads. 

Here's the javascript I'm using: http://www.dynamicdrive.com/dynamicindex17/featuredcontentslider.htm

Since I'm already using the prev, next and increment buttons elsewhere, and need another prev and next button, I'm using the direct link javascript they suggest. 

By gregThomas - May 15, 2013

Hi Meg,

The problem is that I'm not familiar with that slideshow system, so I'm not sure what to suggest. 

When I'm implementing a slideshow system, I test the slideshow system using static data, then make it dynamic using CMS Builder data from a section once I've got it working.

If you get any errors PHP errors while implementing it I can guide you through resolving them.

Thanks

Greg

Greg Thomas







PHP Programmer - interactivetools.com