close ad
 
Important WebAssist Announcement
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

different classes in a repeat region

Thread began 3/03/2017 5:24 am by Jamie | Last modified 3/06/2017 10:43 am by Ray Borduin | 819 views | 4 replies |

Jamie

different classes in a repeat region

Hey Ray

Just wondering how I would set the 1st record in the below repeat to add a class

html:
class="responsive-picture mainGalleryImage"

to the image a href but then all the subsequent records to show

html:
class="responsive-picture thumbnailGalleryIMage"
<div class="galleryContainer">
<?php
while(!$Slideshow->atEnd()) {
?>
<a href="#">
<picture><img alt="" src="img/picture-12.svg"></picture>
</a>
<?php
$Slideshow->moveNext();
}
$Slideshow->moveFirst(); //return RS to first record
?>
</div>



Thanks

Jamie

Sign in to reply to this post

Dave BuchholzBeta Tester

Not Ray but this would be the easiest way to achieve what you want:

<div class="galleryContainer">
<?php $count = 0; // add count and set to zero ?>
<?php
while(!$Slideshow->atEnd()) {
?>
<a href="#">
<picture class="responsive-picture <?php echo($count === 0)?'mainGalleryImage'?'thumbnailGalleryIMage'; // check count value and display appropriate class ?>"><img alt="" src="img/picture-12.svg"></picture>
</a>
<?php $count++; // increment count at end of each loop ?>
<?php
$Slideshow->moveNext();
}
$Slideshow->moveFirst(); //return RS to first record
?>
</div>



You simply add a count and then check it's value and display the appropriate css class.

Regards,

Dave Buchholz
I-CRE8 Limited

Sign in to reply to this post

Jamie

many thanks Dave and much appreciated for taking a look.

Tried to use that but it seems that this echo statement

php:
<?php echo($count === 0)?'mainGalleryImage'?'thumbnailGalleryIMage'// check count value and display appropriate class ?>

is erroring

Thanks

Jamie

Sign in to reply to this post

Dave BuchholzBeta Tester

Bah, to early in the morning, the echo statement should read:

<?php echo($count === 0)?'mainGalleryImage':'thumbnailGalleryIMage'; // check count value and display appropriate class ?>



Regards,

Dave Buchholz
I-CRE8 Limited

Sign in to reply to this post

Jamie

Youre a gem Dave and many thanks!

Jamie

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...