Skip to content
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

Placeholder attribute for textstring #8098

Closed
Myster opened this issue May 13, 2020 · 1 comment
Closed

Placeholder attribute for textstring #8098

Myster opened this issue May 13, 2020 · 1 comment

Comments

@Myster
Copy link
Contributor

Myster commented May 13, 2020

We will often have a field like this:
Label: View product label
Description: Optional: website will show 'View product' if nothing entered here.

I would like to be able to set the placeholder text (alongside the custom validation) so it varies by usage. in this case the placeholder should be "View Product"

additional scenario
We have other fields like this
Label: Title
Description: Optional: Add a title if you need a longer title to show on the actual page, otherwise we will use 'Name' if nothing entered here. (Name will always be used in the navigation)

image

In this case, the placeholder would be the node name, we've actually written some javascript to do this already, and it may be too 'custom' to make a sensible Umbraco Core solution.
But perhaps simply putting {{Name}} in the placeholder input could enable this scenario.
Also the javascript we wrote means that the Title placeholder updates as you type in the Name field.

cascading scenario
We have another field: MetaTitle, which uses Title as it's placeholder if no Title it uses Name.
The solution here could be to have {{Title}} in the placeholder which takes the value from Title, and if Title is absent it takes the placeholder from Title (which would be the node name)

@nul800sebastiaan
Copy link
Member

Thanks @Myster, this sounds an awful lot like the following issue to add default values to Umbraco: #7859

As a sidenote: there are already multiple options to add default values to Umbraco as you can read in #7859 too.

Additionally, I personally think it will be confusing to people to put these default values in a placeholder, to me that signals more that it is a "suggested" value. If I don't fill it in I would expect an empty string to be published. Maybe you can discuss that further on the other issue though.

I'll close this so that discussion can be continue on the central issue #7859.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants