nirsh
July 21, 2022, 7:23am
1
Hi!
I try to show in the home page content from a different page yml.
here’s the other page yml:
title: Feature
- width: 2/3
sections:
inform:
type: fields
fields:
delayFeature:
label: delay timing in seconds
type: number
and this is how I tried to call it in the home page:
<div><?= $pages->find('Feature')->delayFeature()?></div>
the error I get is:
Call to a member function delayFeature() on null
What am I doing wrong?
thanks!
nirsh:
$pages->find('Feature')
Well, what is your page actually called and where does it sit in the page tree. I can only see that your blueprint is called feature…
nirsh
July 21, 2022, 8:47am
3
Thanks for the reply!
When I’m at the home page panel I can add the feautre page. Is this what you meant?
and this is written in the homepgae template:
<div><?= $pages->find('Feature')->delayFeature()?></div>
nirsh
July 21, 2022, 9:25am
4
Ok I’m sorry - I understand now that I need to make ‘foreach’ to get information from each page with the same template. It was early in the morning I was confused