Slideshow not working

17 posts by 3 authors in: Forums > CMS Builder
Last Post: June 5, 2012   (RSS)

Re: [NigelGordijk] Slideshow not working

By Damon - May 31, 2012

Hi Nigel,

I looked at the source code of this page,
http://www.cityofowensville.com/home3.php.

The doctype and html tag are missing from the top. This doesn't effect the image but it should be there.

Also the imagearray on line 78 is empty so there is no image data to display.

Can you try using the standard publish code for upload and see how that works?

I think the issue is with this code and I'm not sure why it is needed:

<?php $firstImage = true ?>
<?php if ($record): ?>
<?php foreach (getUploads($options['tableName'], 'slides', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>

<?php if (!$firstImage): ?>
,
<?php endif ?>
<?php $firstImage = false ?>


Also, can you include a link to your hardcoded page that is working to compare source?

Thanks!
Cheers,
Damon Edis - interactivetools.com

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

Re: [Damon] Slideshow not working

Hi, Damon.

Here we go (attached).

home2.php is the hard coded version; home3.php is the CMSB version.

http://www.cityofowensville.com/home2.php
http://www.cityofowensville.com/home3.php

Thanks,
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net
Attachments:

home2.php 15K

home3_001.php 16K

Re: [NigelGordijk] Slideshow not working

By Damon - May 31, 2012

Hi Nigel,

Can you you try replacing the PHP code inside the imagearray with this:

imagearray: [
<?php foreach ($$homepage_slideshowRecords['slides'] as $index => $upload): ?>
["<?php echo $upload['urlPath'] ?>", "", "", ""],
<?php endforeach ?>

],


This should work. Check it out and let me know.
Cheers,
Damon Edis - interactivetools.com

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

Re: [Damon] Slideshow not working

By NigelGordijk - June 1, 2012 - edited: June 1, 2012

Hi, Damon.

Do you mean replace this:

imagearray: [
<?php $firstImage = true ?>
<?php if ($record): ?>
<?php foreach (getUploads($options['tableName'], 'slides', $record['num']) as $upload): ?>
<?php if ($upload['hasThumbnail']): ?>

<?php if (!$firstImage): ?>
,
<?php endif ?>
<?php $firstImage = false ?>

[
<?php echo json_encode($upload['thumbUrlPath']) ?>,
"",
"",
"<a href='" + <?php echo json_encode($upload['info2']) ?> + "' class='aWhite'>"
+ <?php echo json_encode($upload['info1']) ?> + "</a>"
]

<?php endif ?>
<?php endforeach ?>
<?php endif ?>
],


with this:

imagearray: [
<?php foreach ($homepage_slideshowRecords['slides'] as $index => $upload): ?>
["<?php echo $upload['urlPath'] ?>", "", "", ""],
<?php endforeach ?>

],


Cheer,
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net

Re: [NigelGordijk] Slideshow not working

By Damon - June 1, 2012

Hi Nigel,

Yes, replace your code with mine and it should work fine.

I edited the above post as I had made a typo and had two dollar signs in the code but I have fixed that now.

Try out mine code and let me know if that works.

Thanks!
Cheers,
Damon Edis - interactivetools.com

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

Re: [Damon] Slideshow not working

Sorry, it still ain't happening!

http://www.cityofowensville.com/home3.php

I've attached my updated file.
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net
Attachments:

home3_002.php 16K

Re: [NigelGordijk] Slideshow not working

By Damon - June 1, 2012

Hi Nigel,

I checked you attached code and you need to change this:

$$homepage_slideshowRecords

to this

$homepage_slideshowRecords

That was from a typo I made in my code example but now I fixed my example.

Make that change and let me know. :)
Cheers,
Damon Edis - interactivetools.com

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

Re: [Damon] Slideshow not working

Sorry!

http://www.cityofowensville.com/home3.php
Nigel Gordijk

Common Sense Design: User-focused Web design
Tel: 001 519 342 5348 | Web: www.commonsensedesign.net
Attachments:

home3_003.php 16K

Re: [NigelGordijk] Slideshow not working

By Damon - June 1, 2012

Is the name of the image field called "slides"?

If it is something different change it in this code:
<?php foreach ($homepage_slideshowRecords['slides'] as $index => $upload): ?>
["<?php echo $upload['urlPath'] ?>", "", "", ""],
<?php endforeach ?>


I can take a closer look if you can send in a Support Request with the site details:
https://www.interactivetools.com/support/email_support_form.php?priority=free&message=Forum post: http://www.interactivetools.com/iforum/P93585

Don't post any site details in the forum.

Thanks!
Cheers,
Damon Edis - interactivetools.com

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