Query Options for checkboxes/Select fields

Hi all,

Having a hard time to get this to work, if it´s now supposed to work ?!
Fetch all pages in page “category” that have the value “cat”(checkbox) true .


category:
        label: Category
        type: checkboxes
        options: query
        query:
            page: category
            fetch: index
            value: '{{cat}}'
            text: '{{title}}'

Best regards /

Fred

sorry, just realized that this is not going to work, burned some braincells in the process, DOH !!

What would be nice is this :

category:
        label: Category
        type: checkboxes
        options: query
        query:
            page: category
            fetch: index
            query: "if the checkbox field 'category' is true(checked) for the page in 'category' then go ahead and fetch the value and text"
            value: '{{uid}}'
            text: '{{title}}'

Check this issue, it seems someone has written such a plugin. Not sure it’s publicly contributed yet, but you can ask the author.

2 Likes

I’ve suggested this in the past and got the same response as the issue @Malvese linked to. I have been waiting… nay, yearning for… this feature.

1 Like

Thanks @Malvese, @Luke for the info, appreciate it.

So I hacked it…

panel/app/lib/fieldoptions.php
line 142

case 'index':
        $items = $page->index()->filterBy('category', '1');
        //$items = $page->index();
        $items = $items->sortBy('title', 'asc');
        break;

Hi @bastianallgeier,

Is this maybe something that will come in future releases ?