6 posts by 3 authors in: Forums > CMS Builder
Last Post: May 22, 2016   (RSS)

Hi Anyone

Is there a way to limit to 3 for a certain section only?  I am using the same table for a list on one section of the page where I need to display all of the listings, and in another area on the page, limit the display to only 3 and randomly.

If I use

'limit'       => '3', 

then it affects the first section where I don't want them limited but solves the 2nd section (not what I want) and if I use 

'orderBy' => 'RAND()',

it orders them randomly which I want for the 2nd section, but I actually want the first area on the page when I am using this table to be sorted as editor.

Any suggestions please?

Thanks in advance.

By Damon - May 20, 2016

Hi Deborah,

Your code is right. I tested it and I get the results that you are after.

All the records sorted by date and then three random records.

Can you attach your whole php page and include the URL to where you have this set up?
Or send the details into support@interactivetools.com.

Thanks!

---------------------------------------------------
Cheers,
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

By Deborah - May 20, 2016

Hi, Damon. I was posting a potential solution for degreesnorth, not asking a question. (Just in case you think I'm needing assistance.)

But, thanks anyway!
Deborah

By Damon - May 20, 2016

Hi Deborah,

Whoops. I was reading the thread too quickly. Thought you had posted twice, issue and possible solution.

Thanks for sharing your code!

---------------------------------------------------
Cheers,
Damon Edis
interactivetools.com

Hire me! Save time by getting our experts to help with your project.
http://www.interactivetools.com/consulting/

Hi Deborah

Thank you so much.  Works like a dream and one incredibly useful string of code.

Really appreciate your time to contribute back to me.

Thanks again.

Cheers

Carole