Click here to Skip to main content
Licence CPOL
First Posted 30 Jan 2004
Views 56,800
Downloads 694
Bookmarked 21 times

Microsoft Content Management Server Custom Properties Placeholder

By Stephen Huen | 15 Feb 2005
A placeholder control that allows authors to edit Posting Custom Properties directly in a page.
1 vote, 16.7%
1

2
1 vote, 16.7%
3
1 vote, 16.7%
4
3 votes, 50.0%
5
3.78/5 - 6 votes
μ 3.78, σa 2.80 [?]

Sample Image - cmscustompropertiesph.gif

Summary

For use in Microsoft Content Management Server, this is a placeholder control that allows authors to edit Posting Custom Properties directly in the page. In authoring mode, Custom Properties are rendered in textboxes or listboxes for users to enter values. In unpublished non-preview mode, Custom Properties are rendered in text values. In published or preview mode, nothing will be rendered.

Both C# and VB.NET versions are included.

Description

Although this is built as a placeholder control, nothing is actually saved to the placeholder. I started out developing this as a plain web control but could not find a suitable event to save the Custom Properties. You see, there is no CmsPosting_Saved event. The best compromise is CmsPosting_Changed event and check for PlaceholderPropertyChange action. But if there are five placeholders in a page, my routine will be run five times! More problematic is that this action does not take into account the situation when a page does not have any placeholders, like summary page for a channel cover. That's why I built it as a placeholder control.

This control will not render Custom Property of the selection type if it contains one allowed value only. This type of Custom Property setting is usually used for template logic and does not serve any authoring purpose since you cannot change the value.

The styling of the Custom Properties table rendered is not meant for customization. To set it apart from regular page content, the table uses the built-in CMS look and feel. The table title is customizable however, and is exposed through a public property TableTitle. The default value is "Custom Properties". Since all the table fields come with CSS classes, you can still use an external stylesheet to customize the look and feel of the table.

Installation Procedures

Please reference section "Custom Placeholder Controls" in CMS documentation. It is located in Site Development: Developing Your MCMS Site: Extending the Functionality of MCMS: Creating Custom Placeholders: Custom Placeholder Controls.

History

  • V1.0 - 2004.01.30 - Base.
  • V1.1 - 2004.05.05
    • Added C# version.
    • Background color of alternate table rows now renders properly.
  • V1.2 - 2005.02.13 - Fixed error in authoring preview when custom properties are changed. (Please note that class namespace has been changed.)

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

About the Author

Stephen Huen

Web Developer
Questech Systems
Canada Canada

Member


Sign Up to vote   Poor Excellent
Add a reason or comment to your vote: x
Votes of 3 or less require a comment

Comments and Discussions

 
You must Sign In to use this message board. (secure sign-in)
 
Search this forum  
 FAQ
    Noise  Layout  Per page   
  Refresh
GeneralPlaceholderToBind Pinmemberlwatzon4:04 22 Feb '07  
GeneralRe: PlaceholderToBind PinmemberStephen Huen9:19 22 Feb '07  
GeneralSave custom properties when saving posting PinmemberNikolaj20082:10 16 Sep '04  
QuestionAdd Custom properties im web mode? Pinmembereriknils21:34 18 Aug '04  
AnswerRe: Add Custom properties im web mode? PinmemberStephen Huen6:11 19 Aug '04  
GeneralRe: Add Custom properties im web mode? Pinmembereriknils20:36 19 Aug '04  
GeneralPosting events PinsussAnonymous6:34 4 Aug '04  
FYI in CMS02 you can tie in to posting events either through the old asp scope hooks (IIS_IR/wbc/customizable/hooks folder) or through a HTTP module. Obviously both are undesirable as they are at a global site level rather then localy but it would mean that you could eliminate the need to have an empty placeholder definition sitting there.

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.

Permalink | Advertise | Privacy | Mobile
Web04 | 2.5.120210.1 | Last Updated 15 Feb 2005
Article Copyright 2004 by Stephen Huen
Everything else Copyright © CodeProject, 1999-2012
Terms of Use
Layout: fixed | fluid