craftcms / cms

Build bespoke content experiences with Craft.
https://craftcms.com
Other
3.21k stars 624 forks source link

Feature Request: Default values for Plain Text and Rich Text fields #2031

Closed robmcfadden closed 3 years ago

robmcfadden commented 6 years ago

When creating a new Plain Text or Rich Text field, it would be helpful to be able to optionally enter a default value. This could then be parsed for element variables as an object template.

Use case:

We have a client with over a thousand entries in a section and a couple fields that follow the same formula, with only the {title} being dynamic. The alternative is creating a Global or putting the default value right in the template.

@timkelty was talking about potentially making a plugin for this, but thought it might be a good candidate for a core addition.

timkelty commented 6 years ago

Ended up making this for a client (right now just Craft 2): https://github.com/timkelty/craft2-defaulttext

benface commented 3 years ago

@brandonkelly Would you accept a PR for this?

brandonkelly commented 3 years ago

@timkelty works here now so maybe we can just get him to PR it :)