Panel Page Field + Languages

languages
multilang
panelfield
panel

#1

I’m having trouble using panel page field with multi languages, it seems that panel cannot find translated link URL-Key. Any suggestions?

EN:

IT: product page with URL-Key set to prodotti


#2

The search function only searches in URI and title…, not in other fields.

/panel/app/src/panel/search.php, #44ff

    if(empty($pages)) {
      $pages = array();
      foreach(panel()->site()->index() as $page) {
        $pages[] = array(
          'title' => (string)$page->title(),
          'uri'   => (string)$page->id(),
        );
      }
      $this->cache->set('pages', $pages);
    }

You could, of course, modify this… But would have to keep that in mind when updating in the future.


#3

Hi @texnixe so basically I can’t use page field :sweat:… how do you normally insert internal CTA’s on multi-language projects?


#4

Oh, sorry, I thought you meant search, not the page field, but it is basically the same. What you could do is create a custom page field…

Edit: How about using a quickselect field and the title as text option instead?


#5

Thank you @texnixe I’ve solved using:

pageLink:
  label:
    en: Link
    it: Link
  type: quickselect
  options: query
  query:
    fetch: pages
    value: '{{uri}}'
    text: '{{title}}'

Sadly this is temporally solution, because the page field should work by default since the multi-language its part of Kirby’s features.

Update:
I moved this topic to issues category.