Hallo,
i have to fetch table from page “aandb” to “c” (templates names). I have read a few topics about fetching, but i have not found working solution for me (i probably doing some wrong)…
This first line doesn’t make sense. page() refers to a single page, you cannot filter this. You can pass an URI to the page helper and then fetch the children:
page('projects')->children()`
But I’m not sure what you want to filter here.
Oh, and the information that there is a problem somewhere, is not really that helpful. Could you please post the exact error message?
Are these pages A and B direct main pages, i.e. directly subfolders of the content folder? If not, could you please outline the structure of the folders inside the content folder?
You can fetch single pages using the pages()helper. It accepts an array of page URIs as argument.
foreach(pages(['page-a', 'page-b']) as $subpage):
// code
endforeach;
The error pops up because in your original code $subpage is not a page object.
Assuming these pages are root pages, you can do this:
foreach($pages->filterBy('template', 'rzesyibrwi') as $subpage)
//code
endforeach;