I have the following blueprint…
title: Homepage
columns:
- width: 1/2
sections:
books:
type: fields
fields:
book1:
label: BOOK 1
type: headline
numbered: false
sectionheading1:
label: Heading of Section (optional)
type: text
booktitle1:
label: Title of First Book
type: text
bookcover1:
label: Image of First Book Cover
type: files
layout: cards
max: 1
bookdesc1:
label: First Book Description
type: textarea
line:
type: line
book2:
label: BOOK 2
type: headline
numbered: false
sectionheading2:
label: Heading of Section (optional)
type: text
booktitle2:
label: Title of Second Book
type: text
bookcover2:
label: Image of Second Book Cover
type: files
layout: cards
max: 1
bookdesc2:
label: Second Book Description
type: textarea
- width: 1/2
sections:
reviews:
type: fields
fields:
review:
label: Customer Reviews
type: structure
fields:
bookname:
label: Book Name
type: select
options:
theforgotten: The Forgotten
takingroot: Taking Root
bookreview:
label: Review
type: textarea
author:
label: Author of Review
type: text
I am trying to print out a random review but cannot seem to get any meaningful result.
In my last attempt I tried to print out all the reviews with the code below but with no success. Can anyone advise please.
<?php foreach ($page->reviews()->review()->toStructure() as $review): ?>
<?php echo review->bookreview() ?>
<?php endforeach ?>