Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Display Content from Random child Page (based on Count)


Go to End
Reply


10 Posts   3275 Views

Avatar
tobych

Community Member, 97 Posts

10 November 2009 at 6:49pm

Linsey,

You're not actually getting a random child of a particular page here, of course. You're getting a random instance of a particular class. That's fine if all instances share the same parent.

I've just used this code to generate a random testimonial on a home page: pretty much the same use case as you have, it appears.

I can't offer code to produce a random child right now, as I'm too trying to get a site ready. Just wanted to warn people.

Toby

Avatar
biapar

Forum Moderator, 435 Posts

11 November 2009 at 12:04am

I confirm this:

"You're not actually getting a random child of a particular page here, of course. You're getting a random instance of a particular class. That's fine if all instances share the same parent. "

Because tested... -:)

Bye

Go to Top