Hi, I have some hard time getting this right. Just need a little help to get this category view done.
So what I have on the site is the following. I have Product page that have children. And on each it is a field that I want to use as category name for sorting. So I want to title of field as title on the area and then attach additional icon maybe. That i know how to fix if I just get the loop right.
And under each section on the same page see the pages belonging to each section.
The upper() field method can only be used on a field object, but category is not a field object, but a string in this context. Use a string method (str::upper(), I think) instead.
On a side note: make sure that all your subpages have a category field (should be the case if you use the Panel). Kirby throws an error if the field is missing (e.g. if you use a text editor to edit your files)
Don´t get this to work today. Since I have a array to check and not just one value.
<?php $groups = page('products')->children()->visible()->filterBy('category') ?>
<?php
$categories = $groups->groupBy('category');
// The rest of the loop...
This do not wrack the page, but also do not pass anything.