Regarding the thumbnail-property in PageList


I'm trying to figure out how the thumbnail-property works. I need to get a picture out of my news pages that are listed and I wonder if this is the way to go. Can't find any documentation on it, though. I read somewhere that thumbnail might be disappearing in the future so would it perhaps be better to use a user defined image-link?

Dec 01, 2009 15:39

Hmm never heard of the thumbnail property before. Do you mean you created a property with the name Thumbnail, and are trying to retrieve its value?

Dec 01, 2009 19:02

I'm trying to use this code to display what I thought was a picture  but I find no info on it. It's in PageList.ascx.cs

        protected string GetImage(PageData page)
            if (ThumbnailProperty != null)
                string _imgTag = "<img src=\"{0}\" alt=\"{1}\" />";
                return string.Format(_imgTag, page[ThumbnailProperty], page.PageName);
            return string.Empty;

Really, what I'd like to do is; I've got a property containg a picture-link that I'd like to list in the pagelist, next to the pagen ame and the preview text.

Dec 01, 2009 19:07

Ah I see, first you need to create a new property on your news page type of type URL to image and give it name of ThumbnailImage or something similar. Then in the page template (.aspx), where you're adding the PageList user control, you need to set the PageList user controls ThumbnailProperty property to the name you gave your property (ThumbnailImage).


<public:PageList PreviewTextLength="200" PageLinkProperty="MainListRoot" MaxCountProperty="MainListCount"
ShowTopRuler="true" runat="server" ThumbnailProperty="ThumbnailImage" />

Dec 01, 2009 19:15

Man, that's simple! My questions and your answers are about to create a little how-to on it's own.

Thanks. Again!

Dec 02, 2009 8:09

Hehe, glad I could help :).

Dec 02, 2009 17:05
This topic was created over six months ago and has been resolved. If you have a similar question, please create a new topic and refer to this one.
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.