close ad
Help us test the new Databridge BETA with MySQLi support
open ad
View Menu

Technical Support Forums

Free, outstanding support from WebAssist and your colleagues

rating

images loop not displaying

Thread began 3/06/2012 5:16 pm by Christopher West | Last modified 3/08/2012 3:03 pm by Jason Byrnes | 626 views | 5 replies |

Christopher WestCommunity Expert

images loop not displaying

Hello, ok my website is build up using webassist plugins (but I've also tried on single page) I have a series of client portfolios that have a title, short description and a set of photos) so the client are in a repeat region since these can be added to by Admin. then their photos are in a repeat region. but I have tried many different approaches and I cannot get the correct photos to loop for each individual client. The beauty of plugins is that I can reference a URL parameter but that don't work. I tried to do a Join, Left Join etc (but must have that set up wrong. The fields are:

PORTFOLIO table
PortfolioID
PortfolioTitle
PortfolioTXT
PortfolioImgID

IIMAGE table
ImagesID
ImagesFile
ImagesClientID

How would I define recordset so that I can repeat the portfolio table to display all records then also do another repeat (sons repeat inside a repeat) so that I can display all images that relate to each portfolio.

Would I need 1 or 2 recordsets and would they both be at the beginning of the page or one recordset defined inside the first loop?

Kind regards to anyone that can help :)

Sign in to reply to this post

Jason ByrnesWebAssist

you table set up seams off


PortfolioImgID seams to create a relationship to the images table? is that correct? if so that is backwards, it will create a one image to many portfolios relation instead of the many images to one portfolio relationship that you are after.


looking at the table definition, it seams the first problem is that you haven't properly defined the relation between the tables

in the images table, you should have a column in which you store the ID of the portfolio


to show the images for the portfolio will take some custom coding. you need to have the recordset that looks up the images inside the loop that shows the portfolio. this recordset will filter based on the current portfolio ID in the portfolio recordset. then have a second loop to show all the images

Sign in to reply to this post

Christopher WestCommunity Expert

My apologies its just my naming conventions. In the Images table the ClientID stores the number from the Portfolio table (I just named it confusinging)

What custom coding do I need as I tried my best on different approaches. Isn't it just a case of creating a JOIN record set so that both tables are accessible together in the bindings table via the Join. So that if I am in a repeat nesting both tables will work together? Could you explain how to set up required custom coding? I tried already nesting repeats using repeat region. And I tried doing a join but that didn't work. I even tried putting the image repeat display in a separate file and using framebuilder plugins to call that file inside the repeat and use a URL parameter call in the record set.

Sign in to reply to this post

Jason ByrnesWebAssist

no, you wouldn't use a join for this.


you would need 2 recordsets
the first to return portfolios

the second to return the images. the code would need to be structured like this:

-portfolios recordset
-portfolios repeat region
--echo portfolio name and other details
--images recordset
--images repeat region
----echo images recordset information
--end images repeat region
-end portfolios repeat region


in the images recordset, you would need to use advanced view to create it as:
SELECT * FROM IMAGE WHERE ClientID = paramClientID

in the variables section create a new variable as:
name: paramClientID
type: integer
default value: -1
Run Time value: $row_<portfolioRecordsetName>['PortfolioID']

where <portfolioRecordsetName> is the name of the portfolio recordset

Sign in to reply to this post

Christopher WestCommunity Expert

well thats just odd. that was the method I was going to do originally. but hadnt tested putting the recordset in the middle of the loop, funnily enough thats exactly what i was going to do. however I had to copy and paste the repeat region since dreamweaver wouldnt allow me to create another repeat region inside another, stating it didnt like doing nested regions in a behaviour. I tried using the webassist repeat selection but it came out with a different error. anyway hand coding allowed to work so its all playing nicely - What I am learning as that I do need to learn more hand coding skills, as relying on automatically generated code isnt enough for some websites. but its all good as thats exactly what I want to do :)

thnaks for the help :)

chris

Sign in to reply to this post

Jason ByrnesWebAssist

glad to hear it is working.

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