2

I have a plain text field that encourages content editors to write a more detailed description of a piece of content.

However, on the front-end the template will use the post title by default if this is not supplied.

I would like the placeholder text for this optional plain text field to represent the reality of this in the Dashboard - i.e. to display the title field as the placeholder if the field has not otherwise been used.

When editing the field, I have tried setting the 'Placeholder Text' as {title}, but this does not work - it displays "{title}"!

Is this possible? I don't want to create a new custom type of field as it seems a little heavy handed for this use case.

1

When editing the field, I have tried setting the 'Placeholder Text' as {title}, but this does not work - it displays "{title}"!

Yeah, those placeholder text fields aren't dynamically parsed as Twig templates like others (Entry URL Format, etc.).

I don't want to create a new custom type of field as it seems a little heavy handed for this use case.

Unfortunately that's all that is coming to mind for me for this use-case.

| improve this answer | |
  • Thanks Brad. Is it possible to create such a field that still stores the data exactly as it would if it was a regular text field? i.e. so if I switched it from my custom field back into a 'regular' text field, I wouldn't loose all my values in the DB? – ianp Mar 7 '17 at 13:34
  • 1
    Assuming the custom field uses the same type and size datatype in the database, the conversion should happen automatically. – Brad Bell Mar 7 '17 at 19:50

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.