Selectable child pages on pages field with query language

I want to select child pages of specific page (for ex: /pages/categories)


If i use query language, i cant select child pages (not shows “icon-angle-right”):

FireShot%20Capture%20682%20-%20Samsung%20Galaxy%20A7%202018%2064%20GB%20(Samsung_%20-%20http___localhost_pixelshop_panel_p

Blueprint

categories:
    label: Categories
    type: pages
    multiple: true
    min: 1
    max: 5
    required: true
    options: query
    placeholder: Select Categories
    query: site.find("categories").children

If remove the query language, i can select but opening all pages. Second image is expected output.

FireShot%20Capture%20680%20-%20Samsung%20Galaxy%20A7%202018%2064%20GB%20(Samsung_%20-%20http___localhost_pixelshop_panel_p

FireShot%20Capture%20681%20-%20Samsung%20Galaxy%20A7%202018%2064%20GB%20(Samsung_%20-%20http___localhost_pixelshop_panel_p

Blueprint:

categories:
    label: Categories
    type: pages
    multiple: true
    min: 1
    max: 5
    required: true
    placeholder: Select Categories

Is it possible with query?

This is about following code snippet but i didnt understand about v-if="model". Query doesn’t return a model?

<k-button
  v-if="model"
  :disabled="!page.hasChildren"
  :tooltip="$t('open')"
  icon="angle-right"
  @click.stop="go(page)"
/>

Go to line on GitHub

You can use site.find("categories").index instead of children to get the complete tree. The downside is that you get a flat collection, not a tree structure if you use a query.

Thanks. I was tried that but there are dozens categories. I need to show categories as tree. Why doesn’t working when use query? Isn’t possible that get pages as tree with query?

Unfortunately not, but there is already an issue in the ideas repo that you might want to upvote as well_

Thank you, upvoted :+1:

Hope, i solved it: