Click here to Skip to main content
15,881,715 members
Articles / Web Development / ASP.NET
Article

Microsoft Content Management Server Thumbnail Images Placeholder (C#)

Rate me:
Please Sign up or sign in to vote.
4.44/5 (8 votes)
17 May 20062 min read 89.2K   1.2K   28   11
An XML placeholder control that displays thumbnails of images in a Resource Gallery.

Sample Image - screenshot.gif

Summary

For use in the Microsoft Content Management Server, this is an XML placeholder control that displays thumbnails of images in a Resource Gallery. In authoring mode, the authors specify which Resource Gallery to generate image thumbnails, the 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 applications include showing the images of an event, for example.

A VB.NET 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 authoring label text and 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 the section "Custom Placeholder Controls" in the 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 all the files in the directory WebControlLibray to the web control library project of your MCMS solution.
  3. Include the placeholder control in your page template. For example:
    ASP.NET
    <%@ Register TagPrefix="wcl"
    Namespace="QuestechSystems.WebControls"
    Assembly=""Web Control Library Assembly Name" %>
    ...
    ... 
    <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>
  4. In authoring mode, the 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 web control directory. In the console file, register the custom actions and change the default actions to the new custom actions. For example:

    To register a custom action, add:

    ASP.NET
    <%@ Register TagPrefix="CustomAction"
      Namespace="QuestechSystems.WebControls.ConsoleControls" 
      Assembly=""Web Control Library Assembly Name" %>

    Change:

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

    to:

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

    and, similarly for AuthoringReeditSaveAction and AuthoringReeditSaveAndExitAction.

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

History

  • V1.0 - 2004.05.08 - Base.
  • V1.1 - 2004.07.08
    • Fixed the NullReferenceException when the control is added to an existing template and an existing page using the template is edited.
    • Split CustomAction.cs into individual class files.
  • V1.3 - 2005.04.14 - Revised the public properties and the CSS styles. Added option for Sort Order, Repeat Direction, and Show Image Size. Some changes based on the code submitted by James Penneck. Thanks!
  • V1.4 - 2006.05.14 - Added the ASP.NET 2.0 version.

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Software Developer (Senior)
Canada Canada
A Microsoft Certified Professional Developer and Technology Specialist.

Experience and expertise in SharePoint 2016 / 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.

Comments and Discussions

 
Questiontemp url but not fixed url, any ideas? Pin
Michael Chao16-Mar-07 10:57
Michael Chao16-Mar-07 10:57 
Answer[Message Removed] Pin
immetoz1-Oct-08 9:45
immetoz1-Oct-08 9:45 
Generalthumbnail quality Pin
jonathan hall14-Mar-07 12:41
jonathan hall14-Mar-07 12:41 
GeneralRe: thumbnail quality Pin
Stephen Huen15-Mar-07 7:27
Stephen Huen15-Mar-07 7:27 
GeneralASP .NET 2.0 Compatibility Pin
istatho12-May-06 6:02
istatho12-May-06 6:02 
GeneralRe: ASP .NET 2.0 Compatibility Pin
Stephen Huen12-May-06 12:27
Stephen Huen12-May-06 12:27 
Generalplease help Pin
moshesp7-Feb-05 5:52
moshesp7-Feb-05 5:52 
GeneralRe: please help Pin
Stephen Huen7-Feb-05 7:18
Stephen Huen7-Feb-05 7:18 
GeneralRe: please help Pin
moshesp7-Feb-05 23:29
moshesp7-Feb-05 23:29 
GeneralRe: please help Pin
Stephen Huen8-Feb-05 5:16
Stephen Huen8-Feb-05 5:16 
GeneralRe: please help Pin
moshesp8-Feb-05 22:45
moshesp8-Feb-05 22:45 

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

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