How to include 2 multi record lists from same table

7 posts by 2 authors in: Forums > CMS Builder
Last Post: November 2, 2009   (RSS)

Re: [jonoc73] How to include 2 multi record lists from same table

By ross - October 28, 2009

Hi Johnathan

Thanks for posting!

Once you know how to do this, it does end up being pretty easy :). It's just a matter of learning how :). Here's what I would do.

To get your first list going, you'll have the usual code at the top of the page like this:

list($guided_tourRecords, $guided_tourMetaData) = getRecords(array(
'tableName' => 'guided_tour',
'perPage' => 2,
));


What you can do is make a second copy of that but change the names slightly so you have something like this:

list($guided_tourFooterRecords, $guided_tourFooterMetaData) = getRecords(array(
'tableName' => 'guided_tour',
'perPage' => 4,
));


See what I did there. Just added "footer" into the variable name and now you have a whole separate list pulling from the same table but with different options. Just use that new variable name in the foreach loop you setup in the footer.

Does that make sense? Let me know what you think :).
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] How to include 2 multi record lists from same table

By (Deleted User) - October 28, 2009

Ross,

This is great. Yes as soon as you explain, it all makes sense - I will understand it all one day no doubt! Oh and it works just fine!

Thanks Jono.

Re: [ross] How to include 2 multi record lists from same table

By (Deleted User) - October 30, 2009

I like to have my sites organized and I wanted to include the footer within an include. That way if I needed to change anything in the footer I just need to change the one file.

However this second multi record list doesn't work in includes - will I need to include this bit of the code at the foot of every page for it to work?

Thanks Jono

Re: [jonoc73] How to include 2 multi record lists from same table

By ross - November 2, 2009

Hi.

Interesting. You should be able to have the header code in the include so that it's always just the one file.

Could you attach a copy of one of your pages as well as the footer include to a reply so I can see how it's setup?

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/

Re: [ross] How to include 2 multi record lists from same table

By (Deleted User) - November 2, 2009

Hi Ross, I have updated the page to have this include in the footer. Details are in the email I sent to you on the 30th Oct.

Thanks Jono

Re: [jonoc73] How to include 2 multi record lists from same table

By ross - November 2, 2009

Hi there.

Whoops. I didn't realize this was all the same thing :). I'll be going through my email as quick as possible and get back to you with some ideas :).

Thanks!
-----------------------------------------------------------
Cheers,
Ross Fairbairn - Consulting
consulting@interactivetools.com

Hire me! Save time by getting our experts to help with your project.
Template changes, advanced features, full integration, whatever you
need. Whether you need one hour or fifty, get it done fast with
Priority Consulting: http://www.interactivetools.com/consulting/