Filter by uuid in pages field


I have a question about the new uuid functionality, specifically about the filtering. I use a pages field like this:

	label: Category
	type: pages
	query: kirby.collection("categories")
	link: false
	required: true
	translate: false

This works fine in the panel and in the frontend. This category field is stored like this in the txt-file btw:

Category: - page://rpB2zendwVFJIkCR

But if I append a filter like this, no page (children of ‘angebote’) will be found:

$categories = ['page://P52Rxoj5JFB3zmMI', 'page://rpB2zendwVFJIkCR'];
$results = page('angebote')->children()->listed()->filterBy('category', 'in', $categories);

What am I doing wrong? At least the page with the quoted content of the txt-file should be found.

Thanks! And a happy christmas and a happy new year to each and every one of you. :christmas_tree:

You have to either add a separator like this:

$results = page('angebote')->children()->listed()->filterBy('category', 'in', $categories, '-');

Or use a callback function where you first convert the field value to pages etc.

1 Like

Ahhh, its so simple! It works. Thank you really much for your quick reply.