No I haven’t added the pagination as I’m clueless where to do it.
Yes I have defined in controller:
<?php
return function($site, $pages, $page) {
// fetch the projects
$projects = page('projects')->children()->visible();
// fetch all tags used in projects. pluck($field, 'separator', unique)
$tags = $projects->pluck('tags', ',', true);
// add the tag filter if there is a tag in the url
if($tag = param('tag')) {
$projects = $projects->filterBy('tags', $tag, ',');
}
// Return the list of projects and tags to template
return compact('projects', 'tags');
};
?>
<?php
return function($site, $pages, $page) {
// fetch the projects
$projects = page('projects')->children()->visible();
// fetch all tags used in projects. pluck($field, 'separator', unique)
$tags = $projects->pluck('tags', ',', true);
// add the tag filter if there is a tag in the url
if($tag = param('tag')) {
$projects = $projects->filterBy('tags', $tag, ',');
}
$projects = $projects->paginate(10);
$pagination = $projects->pagination();
// Return the list of projects and tags to template
return compact('projects', 'tags', 'tag', 'pagination);
};