It is the /models/offers.php file which breaks the code…
Shouldn’t the /models/offers.php create the virtual pages which then the /snippets/offers.php can call?
Oh I see there is a mistake in /snippets/offers.php in Line 2. It should be $data instead of $page. But $data does not work as well.
Edit:
Ok, found it.
I had to rename the function in models/offer.php from “children” to “anyname” and then I can call that function in snippets/offers.php
But why did php not output a clear error saying “functionname already used” ? (I did turn on debug in config.php).
No, if you want these entries from the csv file to be children of the offers page, the method in the model must be called children() not anyname, that doesn’t make sense. The whole purpose of the model is to overwrite the children() method of the parent model/class.
But exactly, it must be $data->children(), not $page->children() because $page would refer to the calling page, i.e. home.
I’m sorry, but I will never understand why the documentation is so minimalistic.
For a beginner like me, every char and filepath is important to understand the big picture.