-
Notifications
You must be signed in to change notification settings - Fork 2.5k
Add Placeholder setting to TextField #18564
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
This change introduces a new `Placeholder` option in `TextFieldSettings` and exposes it in the field settings UI. The placeholder value is passed through the TextField driver and rendered in the editor template so that content authors can see it in input fields. Refs OrchardCMS#18562
|
Thank you for submitting your first pull request, awesome! 🚀 If you haven't already, please take a moment to review our contribution guide. This guide provides helpful information to ensure your contribution aligns with our standards. A core team member will review your pull request. If you like Orchard Core, please star our repo and join our community channels. |
|
@dotnet-policy-service agree |
|
Please check the other editors for the text field. I think some of them may also benefit from showing the placeholder text (e.g. email, phone, url, etc.). |
|
@plamco we would appreciate if you could do the same change on other fields that support this attribute. Maybe also update the existing editors that would support it. |
…PickerField, TagsField Refs OrchardCMS#18562
@sebastienros These fields currently have hard-coded placeholders or partial implementations, so I refactored them to use the new Settings + Driver + Shape pattern: - YouTubeField Let me know if you'd like this PR to also cover any additional fields. Default value of string.Empty has been added to Placeholder to prevent null reference issues in the UI Testing / Demo: |
|
Remember to include the appropriate editors for each field type. For example, a text field can have an email editor, which outputs an HTML tag like Editor-specific views follow the naming convention: |
src/OrchardCore.Modules/OrchardCore.ContentFields/Views/ContentPickerField.Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.ContentFields/Views/UserPickerField.Edit.cshtml
Outdated
Show resolved
Hide resolved
src/OrchardCore.Modules/OrchardCore.Taxonomies/Views/TaxonomyField-Tags.Edit.cshtml
Outdated
Show resolved
Hide resolved
…iselect component Refs OrchardCMS#18562
|
Congratulations on your first PR merge! 🎉 Thank you for your contribution! We're looking forward to welcoming other contributions of yours in the future. @all-contributors please add @plamco for code. If you like Orchard Core, please star our repo and join our community channels. |
|
@github-actions[bot] I've put up a pull request to add @plamco! 🎉 |

Description
This PR adds a new Placeholder setting to the TextField settings model.
Changes included:
Why:
The placeholder improves the editor experience by giving content authors contextual guidance when entering text values.
Testing
Closes #18562
Video:
https://www.dropbox.com/scl/fi/61roa9rhdm25t292e9kgg/textfield_placeholder.gif?rlkey=f4moandkjkre8g4ofd4f30w9l&dl=0