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

displaying content

Thread began 6/26/2017 6:08 am by Jamie | Last modified 6/29/2017 10:57 am by Ray Borduin | 97 views | 10 replies |

Jamie

displaying content

Hey Ray

Just wondering how I would, using this one recordset I could return the first record as the mainImage and then any other records get displayed as a submimage within the repeat region? Cheers, Jamie

<?php
$_GET["GalleryContent"] = "gallery_".$PageContents->getColumnVal("ProductContentsID");?>
<?php
$Gallery = new WA_MySQLi_RS("Gallery",$DBConnection,0);
$Gallery->setQuery("SELECT * FROM gallery_category WHERE GalleryPage = ? AND Live = 1 ORDER BY GalleryOrder ASC");
$Gallery->bindParam("s", "".$_GET['GalleryContent'] ."", "-1"); //colname
$Gallery->execute();?>





<div class="container container-1">

<a href="./images/gallery_c/<?php echo($Gallery->getColumnVal("GalleryImage")); ?>" class="responsive-picture mainIMage fancybox" data-fancybox-group="gallery"><picture><img alt="Placeholder Picture" src="./images/gallery_c/<?php echo($Gallery->getColumnVal("GalleryImage")); ?>"></picture></a>


<?php
while(!$PageContents->atEnd()) {
?>
<a href="./images/gallery_c/<?php echo($Gallery->getColumnVal("GalleryImage")); ?>" class="responsive-picture subImage fancybox" data-fancybox-group="gallery">
<picture><img alt="Placeholder Picture" src="./images/gallery_c/<?php echo($Gallery->getColumnVal("GalleryImage")); ?>"></picture>
</a>
<?php
$PageContents->moveNext();
}
$PageContents->moveFirst(); //return RS to first record
?>

</div>
Sign in to reply to this post

Ray BorduinWebAssist

Just cut and paste the sub-recordset code into the repeat region and it should work fine.

Sign in to reply to this post

Jamie

Do you mean that I would need to have 2 record sets to achieve this and not be able to use just the one I have?

Sign in to reply to this post

Ray BorduinWebAssist

Sorry I didn't understand the question.

Just add this before the repeat region:

<?php
$PageContents->moveNext();
?>

Sign in to reply to this post

Jamie

sorry, that doesnt work (it stops any of the sub images from showing)....

have attached the page so you can see it in context and also a link to the live page

Sign in to reply to this post

Ray BorduinWebAssist

Do the sub images show before adding that line? Maybe the recorset has to be updated to include the sub-images? It looks like there aren't any sub-images in the recordset to begin with.

Sign in to reply to this post

Jamie

the main image and sub images all come from the same rs. mainImage and subImage are just the styling classes. I am just trying to get the first rexord returned to be shown with the class mainImage and all subsequent images to be shown with the class subImage

Sign in to reply to this post

Ray BorduinWebAssist

But it looks like the recordset is only returning one row to begin with. Does it have more rows?

Sign in to reply to this post

Jamie

in the case of the link I shared, there are 2 records (http://prntscr.com/fozrep). At the moment only the first record is showing as both the main image as well as the sub image where I want anything that is not the frst record to show as a sub image

Sign in to reply to this post

Ray BorduinWebAssist

So you should be able to show the first image with just regular bindings.

Then add the code:

php:
<?php

$RecordsetName
->moveNext();
?>



To move to the next image. Add the wrapping div or whatever for the sub-images and then add a repeat region for the recordset and it should all work.

Sign in to reply to this post
loading

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