Modify the built-in EPiServer properties

April 9, 2010

When you are creating a page type in EPiServer you have a lot of configuration settings you can do. You can set the default value, hide it from the Edit interface, make it mandatory and so on. For the built in properties it’s another story, you can set the default values for some of them, but that is pretty much it.

Probably the most common request for this functionality is how to hide the categories property/tab as it doesn’t make sense to display it if you are not using categories on your site. The same logic would apply to the URL segment property if the site for some reason doesn’t have Friendly URLs turned on. Mari Jørgensen wrote a blog post when EPiServer 5 was release on how to hide the categories property and Fredrik Haglund also wrote a piece on how to move properties to another tab.

I’ve been using similar techniques for a lot of clients the last couple of years but I never got around to packaging it up. Until now. So this is how the MetaPropertyModifier came about. The module is easily installed by dropping a single dll into your bin folder as it is using a VPP provider for embedded resources.

Once there, a new entry called “Modify meta properties” will appear in the Tools menu in Admin mode. This plug-in will allow you to change if a property should be displayed in Edit Mode, if it’s required and what Tab it should be displayed under. Settings can made for all page types at once or for a specific page type.

Admin tool screenshot

All settings are stored in a configuration section in the web.config, which mean that they can also be stored in a referenced file. This is recommended to avoid that the application restarts every time changes are made.I chose this storage mechanism to make it easy to move configuration between different environments.

You do not have to make any additions to the web.config yourself as long as your application pool has modifying rights to the web.config and you don’t mind storing your settings in an external configuration file called metaPropertyModifier.config.

To uninstall the module, simply deleting the dll and remove any sections created in the web.config.

If you are running your site with the EPiServer interface in English, the module will load all language settings from an embedded resource, but you can add your own language files to the lang folder for any new languages or if you want to replace the embedded English ones.

The version attached has been compiled against EPiServer CMS 5 R2 SP2, but it was developed with version 6, so it works fine with that too.

Try it out and let me know what you think and if anyone care to get their hands on the source code they can give me a ping or I can upload it all to EPiCode.

Download binaries

Cheers
Henrik

Advertisements

11 Responses to “Modify the built-in EPiServer properties”

  1. Per Nergard Says:

    Nice touch with embedded lang files with the possibility to add your own to override them.

    If you could send me the source it would be great.

    /Per


    • Thanks, maybe the embedded language files feature is worth a blog post of its own?

      Source code should be in your inbox any minute

      /h

  2. Per Nergard Says:

    Definitely worth a blog post of its own.
    Thx for the code.

    /Per


  3. […] a standard way for us to embed EPiServer language files within these module assemblies, the MetaPropertyModifier that I wrote about the other week is built with embedded language files. The key requirements that we set up for this was that it […]

  4. Nina Jörmgård Says:

    Great plugin! If you could email the source code I would be very greatful.
    /Nina


  5. […] Modify the built-in EPiServer properties […]

  6. whyleee Says:

    Hi, Henrik. Could you please upload your source code somewhere?
    We are thinking about hiding our custom common properties for some sites..


    • Not that I mind sharing the code (just need to digg it up first), but why would you need to use this hack to modify your own custom properties when you can change this without resorting to this hack?

      • whyleee Says:

        We have several sites using common framework. The problem is, that some common properties are not applicable to some sites and it will be good to hide them. Of course, we want to do this using config file, to not repeat the same settings on all environments.

  7. Michal Says:

    Hi. Excellent plugin. Did You manage to digg up the sources? I would require to debug it, as there are some errors throwed when SSL is used.


Comments are closed.

%d bloggers like this: