Is it possible to translate DEFAULT in the panel?

Hello. I hope someone can help me with my problem. :slight_smile: It’s about the following blueprint setup:

subheadline:
label: Rubrik
type: text
default: Kompetenzen
readonly: true

The website is trilingual.

As you can see, I work with a default value in the blueprint. Is there any way to translate it? Kind of like here:

subheadline:
label: Rubrik
type: text
default:
de: Kompetenzen
en: Competences
gr: ικανότητες
readonly: true

Thank you!

If I get you right, you want to save this value in the corresponding text files, don’t you? Not display the value depending on what user language is selected. If so, that is not possible like this.

Why do you need this value in the form, anyway, since it can’t be changed by the user? Or rather, why not leave this untranslated and then use language variables in your templates?

Thanks for your help!

Crap :slight_smile: I thought there was the easy way to translate the defaults in a blueprint.

Explaining why I’m using a default at this point would probably go beyond the scope. I think I’ll find a good other solution, too.

I have another question, however:
Is it possible to retrieve the contents of a simple text field of the parent page in a child blueprint? No fetch select query something from parent page, but a simple text field with one value?

Each page has its own “subheadline”. Subpages, however, get their subheadline from the parent. In the template like this:

<? = $page->parent ()->subheadline ()->html ()? >

And that’s what I want to show in the blueprint of the child, too. (Basically for the customer, so that he understands that the field is predefined.) --> A prefilled field “subheadline” in the child blueprint, readonly, value from the parent.

Do you understand what I mean – or am I too complicated when it comes to my requirements? :smiley:

You can’t put any logic into a blueprint, but you could use the Kirby logic field with a callback like this:

c::set('plugin.logic.field', function($field, $page) {
  return '<input class="input input-is-readonly" readonly value="'. $page->parent()->subheadline() .'">';
});

In a multi-lang environment, this will automatically pull in the content from the corresponding language.

1 Like