Try our conversational search powered by Generative AI!

Per Gunsarfs
Sep 21, 2015
  4435
(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
Optimizely Forms: Safeguarding Your Data

With the rise of cyber threats and privacy concerns, safeguarding sensitive information has become a top priority for businesses across all...

K Khan | May 16, 2024

The Experimentation Process

This blog is part of the series -   Unlocking the Power of Experimentation: A Marketer's Insight. Welcome back, to another insightful journey into...

Holly Quilter | May 16, 2024

Azure AI Language – Sentiment Analysis in Optimizely CMS

In the following article, I showcase how sentiment analysis, which is part of the Azure AI Language service, can be used to detect the sentiment of...

Anil Patel | May 15, 2024 | Syndicated blog

Optimizely Data Platform Visitor Groups now supports multiple instances

The module V2.0 now supports multiple Optimizely Data Platform instances, allowing personalized content based on real-time segments and profile dat...

Andrew Markham | May 15, 2024 | Syndicated blog