Try our conversational search powered by Generative AI!

Per Gunsarfs
Sep 21, 2015
  4428
(7 votes)

Placeholder text for property editors

Last week I ran into a (slightly hidden) feature in EPiServer that I think could be quite useful in many scenarios. So let's share it! 

What I found it that it's possible to add placeholder/watermark text to the property editors. That is accomplished by setting the "Promt" property on the "Display" attribute for the property. So this code:

 [Display(Prompt = "Enter title here")]
 public virtual string Title { get; set; }

Would generate this:

The caveat to all this is that it will only work for "simple" property editors. I tested it on basic textboxes and date selectors, and it worked great. However, for more complex ones, e.g. a content area editor, the placeholder text will not be shown.

Sep 21, 2015

Comments

valdis
valdis Sep 21, 2015 04:30 PM

Nice!

Sep 21, 2015 08:09 PM

Nice! To bad it doesn't work for contentareas.

Please login to comment.
Latest blogs
A day in the life of an Optimizely Developer - Enabling Opti ID within your application

Hello and welcome to another instalment of A Day In The Life Of An Optimizely developer, in this blog post I will provide details on Optimizely's...

Graham Carr | May 9, 2024

How to add a custom property in Optimizely Graph

In the Optimizely CMS content can be synchronized to the Optimizely Graph service for it then to be exposed by the GraphQL API. In some cases, you...

Ynze | May 9, 2024 | Syndicated blog

New Security Improvement released for Optimizely CMS 11

A new security improvement has been released for Optimizely CMS 11. You should update now!

Tomas Hensrud Gulla | May 7, 2024 | Syndicated blog

Azure AI Language – Key Phrase Extraction in Optimizely CMS

In this article, I demonstrate how the key phrase extraction feature, offered by the Azure AI Language service, can be used to generate a list of k...

Anil Patel | May 7, 2024 | Syndicated blog