Selecting listed pages

Hey everyone (again),

I’m currently building custom block types, I would like to add a simple button, but with an option in blueprint to select internal, listed pages to be linked. Now the blueprint part for that custom block looks like this:

  name: Button mit interner Verlinkung
  icon: bolt
  label: "{{ text }}"
      label: Bitte wählen Sie eine Seite
      type: select
      query: site.pages.published
      type: text

Unfortunately I’m not the brightest about php and querying, the query above shows only first level pages published but not the all, second would be that a “linkable” format to echo it in the template? (probably not? :see_no_evil: )

  1. Since there is a pages field, I’d use that instead of a select
  2. If you want to query all pages over your whole site, use site.index.published
  3. In your template, you can output the link to the page like described in the docs: Files | Kirby CMS

Do you mean something like that? Then it makes the most sense to work with the when condition in the Blueprints. As Sonja already mentioned, a Pages field makes the most sense for the pages.

    type: select
    label: Linktyp
    width: 1/3
    default: linkbuilder_type_page
     linkbuilder_type_page: Seite
     linkbuilder_type_url: Eigene URL
     linkbuilder_type_file: Eigene Datei

    type: pages
    label: Interne Seite
    multiple: false
    width: 2/3
    empty: "Bitte eine Seite auswählen"
      linkbuilder_type: linkbuilder_type_page

    type: text
    label: Eigene URL
    before: "URL"
    icon: url
    width: 2/3
      linkbuilder_type: linkbuilder_type_url

    type: files
    label: Datei
    multiple: false
    width: 2/3
    empty: "Bitte eine Datei auswählen"
      linkbuilder_type: linkbuilder_type_file