Click here to Skip to main content
Click here to Skip to main content

Microsoft Content Management Server Thumbnail Images Placeholder

, 20 Apr 2005
Rate this:
Please Sign up or sign in to vote.
An XML placeholder control that displays thumbnails of images in a Resource Gallery.

Sample Image - screenshot.gif

Summary

For use in Microsoft Content Management Server, this is an XML placeholder control that displays thumbnails of images in a Resource Gallery. In authoring mode, authors specify which resource gallery to generate image thumbnails, thumbnail size, and other sorting and display properties. In presentation mode, all images in the specified Resource Gallery will be rendered as thumbnails with links to the full size images. Practical application includes showing images of an event, for example.

A C# version of this control is available here.

Description

The placeholder control has the following public properties:

  • SelectGalleryDefaultValue
  • ThumbnailSizeDefaultValue
  • NumColumnsDefaultValue
  • SortByDefaultValue
  • SortOrderDefaultValue
  • RepeatDirectionDefaultValue
  • ShowImageSizeDefaultValue
  • ImageExtensions

All these properties are optional. They allow designers to change the default values.

The look and feel of the rendered output can be customized by CSS styles. Do a view source on the rendered page to see all the CSS classes available.

Installation Procedures

  1. 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.
  2. Copy ThumbnailImagesPlaceholder.vb to the web control directory of your MCMS site. Change ProjectName in line 18 to your project name.
  3. Copy ThumbnailImagesLabelItem.vb and ThumbnailImagesItemTemplate.vb to the class directory of your MCMS site.
  4. Include the placeholder control in your page template. For example:
    <%@ Register TagPrefix="wcl"
     Namespace="ProjectName.QuestechSystems.WebControls"
     Assembly="ProjectName" %>
     ...
     ... 
    <wcl:ThumbnailImagesPlaceholder id="ThumbnailImagesPlaceholder1"
    runat="server" PlaceholderToBind="ThumbnailImages" 
    NumColumnsDefaultValue="3"
    ThumbnailSizeDefaultValue="64" SortByDefaultValue="Display Name"
    SortOrderDefaultValue="Ascending" RepeatDirectionDefaultValue="Horizontal"
    ImageExtensions="gif,jpg,png" ShowImageSizeDefaultValue="Yes">
    </wcl:ThumbnailImagesPlaceholder>
  5. In authoring mode, client side validation is done by a validation control. In order for it to work, you need to modify some console actions. Copy the action classes to your root directory. In the console file, register the custom actions and change the default actions to the new custom actions. For example:

    To register the custom action, add:

    <%@ Register TagPrefix="CustomAction"
      Namespace="ProjectName.QuestechSystems.WebControls.ConsoleControls" 
      Assembly="ProjectName" %>

    Change:

    <CmsConsole:AuthoringSaveNewAction id="AuthoringSaveNewAction1"
      runat="server">
    ...
    </CmsConsole:AuthoringSaveNewAction>

    to:

    <CustomAction:ValidatedSaveNewAction id="AuthoringSaveNewAction1"
      runat="server">
    ...
    </CustomAction:ValidatedSaveNewAction>

    and similarly for AuthoringReeditSaveAction and AuthoringReeditSaveAndExitAction.

  6. Include ThumbnailImages.css in the template.
  7. Make sure subscribers have access to the Resource Gallery specified.
  8. Rebuild your site in VS.NET.

History

  • V1.0 - 2004.02.06 - Base.
  • V1.1 - 2004.02.08 - Added rendering of thumbnails in authoring mode.
  • V1.2 - 2004.07.08
    • Fixed NullReferenceException when control is added to an existing template and an existing page using the template is edited.
    • Split CustomAction.vb into individual class files.
  • V1.3 - 2005.04.14 - Revised public properties and CSS styles. Added option for Sort Order, Repeat Direction and Show Image Size. Some changes based on C# code submitted by James Penneck. Thanks!

License

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

Share

About the Author

Stephen Huen
Software Developer (Senior)
Canada Canada
A Microsoft Certified Professional Developer and Technology Specialist.
 
Experience and expertise in SharePoint 2013 / 2010 / 2007.
 
Role ranges from a developer in a multi-person team to a solution consultant with expert-level skills, leading a project to completion status.
 
Proven experience working effectively in a team environment and a self-managed environment.
Follow on   LinkedIn

Comments and Discussions

 
GeneralAdd postings Pinmemberc borkowski25-May-05 9:48 
GeneralRe: Add postings Pinmemberc borkowski25-May-05 9:49 
GeneralError in ImageThumbail Placeholder PinmemberParag Sinkar6-Jul-04 20:25 
I am getting following Error :
 
System.NullReferenceException: Object reference not set to an instance of an object. at VBEtihadControlLib.McmsWebControlLibraryVB.ThumbnailImagesPlaceholder.GetSingleNodeValue(XmlDocument xmlDocument, String nodeName) in C:\MCMS Etihad Site\Etihad\VBEtihadControlLib\ThumbnailImagesPlaceholder.vb:line 513 at VBEtihadControlLib.McmsWebControlLibraryVB.ThumbnailImagesPlaceholder.SetControls() in C:\MCMS Etihad Site\Etihad\VBEtihadControlLib\ThumbnailImagesPlaceholder.vb:line 463
 
I have been debugging the code for a while. Mad | :mad:
xmlString = CType(Me.BoundPlaceholder, XmlPlaceholder).XmlAsString in Function GetXMLDocument() As XmlDocument "returns null"
 
Please Help me
 
Thanks and Regards
 
Parag
GeneralRe: Error in ImageThumbail Placeholder PinmemberStephen Huen6-Jul-04 21:32 
GeneralRe: Error in ImageThumbail Placeholder PinmemberParag Sinkar6-Jul-04 22:51 
GeneralRe: Error in ImageThumbail Placeholder PinmemberStephen Huen7-Jul-04 5:51 

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.

| Advertise | Privacy | Mobile
Web02 | 2.8.140821.2 | Last Updated 20 Apr 2005
Article Copyright 2004 by Stephen Huen
Everything else Copyright © CodeProject, 1999-2014
Terms of Service
Layout: fixed | fluid