Random sub page content

Hi all -

I have a page called ‘testimonials’ with a bunch of testimonials set up as sub pages. I want to show an excerpt (character limit of about 100) from the page text plus the title in a snippet chosen at random from these subpages. I’ve tried the examples at https://getkirby.com/docs/cookbook/random-content but I can’t get it to work!

Any help appreciated.

$randomTestimonial = page('testimonials')->children()->shuffle()->first();
echo $randomTestimonial->title();
echo $randomTestimonial->text()->excerpt(100);

Thanks - however I get what i got before which is the title, but no text.

My blueprint is has the text as a text area like this:

_ title:_
_ label: Name, place and date_
_ type: title_

_ text:_
_ label: Feedback_
_ type: textarea_

Sorry, I corrected my snippet…

2 posts were split to a new topic: Skip children of page in navigation