Display the property name for developers in edit mode
For those of you that have read any of my previous blog posts may have noticed that I like things that make the daily life easier. So here is another thing I have had a need for and hopefully can be of use.
A thing that has been a royal pain since I started with EPiServer is all the times when coding and I need to know a property's name. At least for me when this need arise I’m usually in edit mode entering a value in the particular property I’m interested in.
I hate that I need to go into admin mode and check the property name. And since my memory fails me sometimes I need to do this way to often.
If I was using PageTypeBuilder this wouldn’t be an issue but there are lots of “classic” EPiServer sites out there.
From some earlier investigation I remembered that it’s the PropertyDataForm web control that is responsible for doing the rendering. I had an idea that I could modify it through a page adapter. A bit of googling and I found a post form Andreas Hattestad where he hade done just that.
The PropertyDataForm has a public Itemplate field that we can assign our own template and thus change the rendering of the property's caption.
The result looks like this with the property name in parentheses. I also added a feature so that if you click the property name it’s added to the clipboard for easy pasting in Visual Studio (IE only for now).
Here’s the code
Don’t forget to register the adapter in a .browser file in the App_Browsers folder.
Hope someone find it useful.
As per request here´s a zip with the code.