close ad
WARNING: Do Not Install the DREAMWEAVER CC 2017 or 2018 Update »
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

show image based on order

Thread began 10/03/2017 3:50 am by Jamie | Last modified 10/03/2017 2:26 pm by Ray Borduin | 36 views | 3 replies |

Jamie

show image based on order

Hi Ray

In this snippet

<?php $count = 0; // add count and set to zero ?>
<?php
while(!$Gallery->atEnd()) {
?>
<a href="images/gallery_c/<?php echo($Gallery->getColumnVal("GalleryImage")); ?>" class="responsive-picture <?php echo($count === 0)?'mainGalleryImage':'thumbnailGalleryIMage' // check count value and display appropriate class ?> fancybox" data-fancybox-group="gallery" title="<?php echo($Gallery->getColumnVal("GalleryDescription")); ?>">
<picture>
<img alt="<?php echo($Gallery->getColumnVal("GalleryDescription")); ?>" src="/images/gallery_c/<?php echo($count === 0)?'mainImage/campsite.jpg':$Gallery->getColumnVal("GalleryImage"); ?>" <?php echo($count === 0)?'width="1200" height="500"':'width="110" height="100"' ?>>
</picture>
</a>
<?php $count++; // increment count at end of each loop ?>
<?php
$Gallery->moveNext();
}
$Gallery->moveFirst(); //return RS to first record
?>



How would I change

<?php echo($count === 0)?'mainImage/campsite.jpg':$Gallery->getColumnVal("GalleryImage"); ?>

to show the GalleryImage where GalleryOrder = 1 instead of 'mainImage/campsite.jpg?

Cheers

Jamie

Sign in to reply to this post

Ray BorduinWebAssist

So you are looping through the recordset, but in that area you always want to show the image in the first record for each row?

Sign in to reply to this post

Jamie

It’s not necessarily the first record in the table but the record who’s GalleryOrder = 1

Sign in to reply to this post

Ray BorduinWebAssist

I'd probably do a second recordset above the loop to return that row.

Sign in to reply to this post

Build websites with a little help from your friends

Your friends over here at WebAssist! These Dreamweaver extensions will assist you in building unlimited, custom websites.

Build websites from already-built web applications

These out-of-the-box solutions provide you proven, tested applications that can be up and running now.  Build a store, a gallery, or a web-based email solution.

Want your website pre-built and hosted?

Close Windowclose

Rate your experience or provide feedback on this page

Account or customer service questions?
Please user our contact form.

Need technical support?
Please visit support to ask a question

Content

rating

Layout

rating

Ease of use

rating

security code refresh image

We do not respond to comments submitted from this page directly, but we do read and analyze any feedback and will use it to help make your experience better in the future.

Close Windowclose

We were unable to retrieve the attached file

Close Windowclose

Attach and remove files

add attachmentAdd attachment
Close Windowclose

Enter the URL you would like to link to in your post

Close Windowclose

This is how you use right click RTF editing

Enable right click RTF editing option allows you to add html markup into your tutorial such as images, bulleted lists, files and more...

-- click to close --

Uploading file...