if else with images uploaded using code generator

5 posts by 2 authors in: Forums > CMS Builder
Last Post: October 23, 2015   (RSS)

By Twocans - October 22, 2015

wow sorry,

<?php if ($home_page_big_imagesRecord['check_to_show_big_image'] == '1'): ?> ...my pics...
<?php endif ?>

the above works for me but hehe if its wrong let me know..

cheers

Kenny

By Daryl - October 22, 2015

Hi Kenny,

That's correct. Or you can do it this way too:

<?php if ($home_page_big_imagesRecord['check_to_show_big_image']): ?>
...my pics...
<?php endif ?>

Cheers,

Daryl Maximo
PHP Programmer - interactivetools.com

By Twocans - October 23, 2015

Thanks another quick question on the upload.

I have use the code generator twice on the same page, aka for 2 different sets and both of these recordsets have images. 

My problem is Calling these variables on my page as both are called "<?php echo htmlencode($upload['urlPath']) ?>

how can I get both to show as one is on the top of my page and the others are placed on the bottom of the page. But only can get the top ones to show due to <?php echo htmlencode($upload['urlPath']) ?> is the same for both ?

regards

kenny

By Twocans - October 23, 2015

Sorry about having posted this now as having been testing it all day I was tripping over myself

I see now how to have both appear on the page and that is by also using the repeat

<?php foreach ($home_page_bottom_left_imagesRecord['small_image_upload'] as $index => $upload): ?>

<a href="<?php echo htmlencode($upload['urlPath']) ?>" class="p7lsm_type_img">

<?php endforeach ?>

and

<?php foreach ($home_page_rotationRecord['big_image_upload'] as $index => $upload): ?>

<a href="<?php echo htmlencode($upload['urlPath']) ?>" class="p7lsm_type_img">  <<< I was adding the second call for upload like this but without the foreach thus

<?php endforeach ?>

so now i have learnt lol both need there own foreach.

have a nice weekend

kenny