How to make dynamic placeholder for field in blueprint (from page title)?

Hi, I would like to make seo fields easier to understand for editor, so that till meta title field is not filled, it would show what is actually in head meta title: Page title. Didn’t find, is it possible to do it?

dymanic-blueprint-field-placeholder

That’s (currently) not possible. I wonder if using a placeholder might have a contrary effect to what you want to achieve, i.e. make the user fill the field, because placeholder text is often mistaken for a value.

I think I’d rather use some help text like “If you leave this field blank the title will be used but you might want to provide more meaningful information here”.

Dynamic placeholder would be good solution, we had the same in Drupal previously and didn’t have problems with it. Normally those, who want to change meta title, understand web a bit more. And it’s easier, as then it’s clear, what is active if it’s not filled, no need to “put” page title by imagination. If user will leave it as it is, still no problem, as page title is ok.

Goal in this case is not to make use fill the field, but just to show, what it holds.

Maybe it’s also possible to add buttons near fields, that would trigger modal window with demo, what that means.

modal-window

So that after clicking I can show picture, explaining, what that means:

You can do all this with a custom field.

There is already an ideas issue you could upvote:

1 Like

Thank you, and for detailed information about field can use info field. Not perfect interface, but solving the question

I think a custom field (or a dynamic default value) that actually prefills the field with the title would be even better in this case, because a user could then directly edit the the field content while a placeholder would disappear the moment the user starts typing.

Is it now possible to fill in a field in advance?

You can always use a hook or a page model to actually prefill a field at page creation (so not a placeholder, but an actual value).

yes that would also work, but it would be nicer directly in the blueprint.


I noticed that placeholder: can be used, but it is not yet documented. but that doesn’t solve my prefilled field “problem”

Since Kirby 3.2.5 it is actually possible in the blueprint:

seo_title:
  label: Metatitle
  type: text
  default: '{{ page.title }}'

but that disappears when the user clicks in the field. I need a pre-filled field, it is for a newsletter plugin for the signature / footer

Then go for the page model, imho that’s nicer then the hook.

aha! it works with default:

:innocent:

 signatur:
    type: textarea
    size: small
    default: "test"