I would like to add a select field to the panel, where the admin can select the languages that have been completed and should therefore been added to the language-menu.
Unfortunately I can’t figure out the query for languages, nor find examples in the resources or the form.
I also failed to create a collection.
languages:
label: Active Languages
type: select
width: 1/2
options: query
query: site.languages
I guess I could also solve this by editing the language blueprint and adding an active toggle. Is there an example how to add custom fields to the language blueprint?
Thanks @pixelijn,
Indeed a multiselect makes more sense.
I did start with kirby.languages but it did not work with the simple query method.
Fetching, like explained in the linked thread, does work. Thanks a lot!
languages:
label: Active Languages
type: multiselect
width: 1/2
options: query
query:
fetch: kirby.languages
text: "{{ item.name }}"
value: "{{item.code }}"
Dear @pixelijn, I think it would actually be better to add a toggle to the language directly in the settings. Do you think that would be easily achievable?
I can’t tell you how easy that would be, but the bigger problem is that you cannot query custom fields in the language files. So if you add a custom field to en.php for example, there is no way to retrieve that value via the $language object.
Aww, that’s unfortunate.
I’m struggling to combine the multiselect on the $site level with the actual $kirby->languages() in one foreach loop.
But I’m also not a programmer (that’s why Kirby became my best friend).
How are people hiding languages that are not ready yet for the public?