Are you intending to literally show the list of the pages for information purposes, or is there more to it you want to do? I don’t think its working in the panel because you are in the context of the panel, not the context of the page.
If it’s just a list you want, you can dynamically create structure field content with the info you want, via a hook (page create & page update). I think there, the code you have will work (and i think you can probably do what you have quite a bit shorter). As long as its in the blueprint, you can set its contents from a hook, and set the structure field to read only. I don’t think you need to go the trouble of the plugin.
To save space, you could just populate a readonly select field with the query language.
@jimbobrjames thanks for your idea. the field will be just for display purposes. The query language isn´t my »friend« at the moment, so I will go with texnixes solution.
$this in this context refers to the field, I think, which has certain properties (https://getkirby.com/docs/reference/@/cms/field). $this->parent->url($kirby->language()->code()) would also be possible (Edit: doesn’t seem to work, though, )
Nowhere, I’m afraid. Bastian is currently doing a series of live streams on field development which we will integrate into the website when ready.
But we nevertheless have to update the documentation.