Perhaps it’s allready solved, I don’t really found…
I want to make two links for the same template that will change the array of the snippet inside.
I wrote the projects.html like that :
What is myCategory in the template, that is neither a variable nor a string, but I suppose you want to pass a $categoryvariable (a collection of pages?, a parameter from the URL?) to the snippet.
What is $data, where does that variable come from (nowhere defined), but from the code I’d suppose it is a number.
But then you want to filter your exposition by category, but your category is defined as some sort of collection, so that code doesn’t really make sense.
The myCatergory will be a category of an exposition.
For the moment, when I replace it by 'permanent' or 'non-permanent' (for example) the data change and the page load only 'permanent' expositions or 'non-permanent' expositions in the page , it runs when I do it.
But now I want to load directly the page with the data set. I was thinking about get an attribut in the link to load the exposition page with that attribut instead of myCategory…
Your snippet would then start with the list and the foreach loop.
You still haven’t explained what $data in your snippet is; if it is not an integer, why do you use it with the limit()method that expects an integer?
<?php if(isset($data)) $category = $category->limit($data); // data must be an integer here, otherwise this doesn't make sense; the limit method doesn't make sense if $category is a string
And if $category is just a category, then calling limit()on it doesn’t make any sense anyway, because for that to work, you would need some sort of collection.