I have one list with highlight pages and a need a second list with all pages without the highlight pages.
What is the best way to achieve this?
Thanks in advance for your help
Jens
I have one list with highlight pages and a need a second list with all pages without the highlight pages.
What is the best way to achieve this?
Thanks in advance for your help
Jens
I don’t know how you define your highlighted pages, but let’s assume it’s a filtered list like this:
$highlighted = $page->children()->listed()->filterBy('featured', true);
// then exclude these from the list of all children
$nonHighlighted = $page->children()->listed()->not($highlighted);
As always thanks for your fast response.
is just a list of pages with just the ids, right?
$highlighted
as defined above is a pages object.
But as I said, it’s just an example. If you need more details, you would have to post the code for your highlighted pages.
Thanks @texnixe.
Works perfect:
$allStories = autoid('rachftkj')->children()->filterBy('template', 'story');
$primaryStories = [];
foreach ($data->primary_stories()->toStructure() as $item) {
$primaryStories[] = $this->getPageById($item->page_reference());
}
$primaryStories = new Collection($primaryStories);
$filteredPages = $allStories->listed()->not($primaryStories);