I watched Bastiam video on YouTube “How to build a website from scratch part 2”. So I saw how he used toggle to display projects on the frontend. I am trying to imitate actually what he did but for some reason it will not display on the frontend. Can someone tell me what I am doing wrong.
<?php snippet('featured', [
'featured' => page('furniture')
<?php foreach ($featured as $product): ?>
<?php endforeach ?>
Is that code in the same file?
The second part is supposed to be in the snippet file
/site/snippets/featured.php, which you call in the first part of your code block!
If that’s the case, then
probably doesn’t return anything… Do you have featured pages as children of the
The featured is the snippet.
The foreach is inside the snippet.
The children of the
/furniture page are
/homeoffice and pages on the same level…
That’s what I expected and said above, you are trying to get the wrong level of subpages again. The Austin Coffee Table is not a child of the furniture page, but a grandchild.
Please keep in mind that
children are only the direct subfolders of a given page, not the nested ones. This is important, because you continue having the same sort of problem in many of your questions.
Thank you. I will keep that in mind.