When a search result includes a title or description of an image.. wouldn't it be appropriate to include an image thumbnail in that result item?
It'd be great if this were built-in. But, has anyone modded to do this?
Alrighty- I did some tweaking in my source and now Gallery Post items have thumbs in both Search results and Tag Filter results... like this:
This requires SDK/source modification and recompilation... here's what I did:
Add the "CS:Href.." to Skin-SearchResults.ascx and Skin-TagPostResults.ascx as follows:
The "clear:left" added to the CommonSearchResultDetails class is req in common.css
In each respective codefiles- \Controls\Search\SearchResults.cs and \Controls\Utility\TagPostResults.cs- add to ItemDataBound per following:
{
thumb.NavigateUrl = post.Url;
}
In \Components\Search\IndexPost.cs add the private and public properties:
And then, finally, in \CommunityServerSearchBarrel\GalleryBarrelItem.cs , add code to set ThumbURL property:
Style as you wish in common.css... for example:
.imgSearchThumb
.aSearchThumb
and don't forget the clear:left...
.CommonSearchResultDetails
That should do it! (pardon the formatting here in this post)
Please... recommend fixes.. changes!!
davelee: When a search result includes a title or description of an image.. wouldn't it be appropriate to include an image thumbnail in that result item?It'd be great if this were built-in. But, has anyone modded to do this?
Althrough it is an old post, I'm still wondering about it. It would be also nice to include image thumb in Tags search.
Petrus
Very cool indeed.... I am going to mull this over a bit more, but I was thinking of adding support for attaching an image to any post, and using that as a thumbnail... Possibly adding support for icons of the attachment if its not an image... it seems to be a nice user experience... but you shouldnt let me stop you... Thanks for contributing.
Dan
DanBartels:I was thinking of adding support for attaching an image to any post, and using that as a thumbnail... Possibly adding support for icons of the attachment if its not an image
Great, Dan... I look forward to your ideas.
I couldn't find those *.cs files in Community Server 2007. Will this code need to be changed to work in the new version? I've been looking at the tag browser code all day and still can't get it nailed down.
I hadn't had time to jump into CS2007 yet.. but you're right.. CS2007 will require a different approach.
Yes,it require a different approach,but easier just change two files ,the indexpostlist.aspx(Themes\XXXXXX\Search) and the tagslist.aspx(Themes\XXXXXX\Tags)Add following code
<CSControl:PlaceHolder runat="server" Tag="Div"><DisplayConditions><CSGallery:GalleryPostPropertyValueComparison ComparisonProperty="ApplicationType"
ComparisonValue="Gallery" Operator="EqualTo" runat="server" /></DisplayConditions><ContentTemplate> <div class="PictureList"><div class="ClearLeft"> </div> <div class="pic"> <span><CSGallery:GalleryPostData LinkTo="ViewPicture"
runat="server"><ContentTemplate><CSGallery:GalleryPostImage ImageType="Thumbnail"
runat="server"/></ContentTemplate></CSGallery:GalleryPostData></span> </div> <div class="ClearLeft"> </div> </div> </ContentTemplate> </CSControl:PlaceHolder>
after
<div class="CommonSearchResultArea"> <CSControl:IndexPostData runat="server" LinkTo="Post" Property="Title" Tag="H4" CssClass="CommonSearchResultName" />
And don't forget import gallery assembly
<%@ Import Namespace="CommunityServer.Galleries.Components" %>