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

Microsoft Content Management Server Thumbnail Images Placeholder (C#)

By , 17 May 2006
 

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:
    <%@ 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:

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

    Change:

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

    to:

    <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

About the Author

Stephen Huen
Web Developer Questech Systems
Canada Canada
Member
No Biography provided

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.
Search this forum  
    Spacing  Noise  Layout  Per page   
Questiontemp url but not fixed url, any ideas?membermichael zhao16 Mar '07 - 10:57 
Hi Stephen,
 
in my case, when I save the image in resource gallery, the image url stays as temp url but not fixed url, and after a while the url becomes invalid, I was told the url should be converted to fixed url always, how can I do that? any ideas are highly appreciated
Answer[Message Removed]memberimmetoz1 Oct '08 - 9:45 
Spam message removed
Generalthumbnail qualitymemberjonathan hall14 Mar '07 - 12:41 
the quality of the thumbnails look bad, its a low color-depth gif. Is it possible to change the thumbnails to a jpeg?
 
im thinking this may be a mcms thing rather than this script but any help would be great!
GeneralRe: thumbnail qualitymemberStephen Huen15 Mar '07 - 7:27 
Yeah, this is a mcms thing.
GeneralASP .NET 2.0 Compatibilitymemberstathopi12 May '06 - 6:02 
Is it compatible with ASP .NET 2.0?
 
Thanks
GeneralRe: ASP .NET 2.0 CompatibilitymemberStephen Huen12 May '06 - 12:27 
Yes.
Generalplease helpmembermoshesp7 Feb '05 - 5:52 
i coldn't understand what i need to do with
the files, nothing seems to be working.
what is Assembly="ControlLibraryName"?
do i need to bild the 4 classes and add the referene
to my project?
i need more explanation about this Thumbnail Images Placeholder.
 
thanks

GeneralRe: please helpmemberStephen Huen7 Feb '05 - 7:18 
If you don't have a separate control library project, you can use CMSProjectName instead of ControlLibraryName. Include the classes into your VS project and follow the installation instructions. Hope this helps.
GeneralRe: please helpmembermoshesp7 Feb '05 - 23:29 
thank for the replay
i included the classes to my vs project
so now i can see the dropdowns, but nothing happend
no postback occured.
 
what do you think seemed to be the problem?
 
thanks mosheConfused | :confused:
GeneralRe: please helpmemberStephen Huen8 Feb '05 - 5:16 
What happened when you select an image gallery and click save page?
GeneralRe: please helpmembermoshesp8 Feb '05 - 22:45 
thanks
it's working Smile | :)
 
moshe

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

Permalink | Advertise | Privacy | Mobile
Web02 | 2.6.130523.1 | Last Updated 17 May 2006
Article Copyright 2004 by Stephen Huen
Everything else Copyright © CodeProject, 1999-2013
Terms of Use
Layout: fixed | fluid