I’m struggling to figure this out:
I have a page (“directory-one/page-one”) which has a pages select field in the panel. In this case, the selected page would be “directory-two/page-two”.
When I visit “Page Two” in the frontend, I want to create a cross-reference to the page which has this page selected.
I was trying to approach this with a filter function like this:
// on "Page Two" $wantedPage = page('directory-one') ->children() ->listed() ->filterBy('selectedPage', $page->id())
$page->id() to be the same string the one that would appear on the content file of “Page One”, but on Page One it contains:
SelectedPage: - > directory-two/page-two
Is it possible to solve this without doing something like
->filterBy('selectedPage', '- > ', $page->id())?
Thanks in advance!