ExtendedAttribute Condition Control

I was working a new control for the CarKnee Bundle and was in need of a condition control within Community Server that didn't appear to exist. What I needed was a condition control that checked against a WeblogPost's ExtendedAttributes. What I came up with was the "PostExtendedAttributeComparison."

I use this comparison as follows:

<CSControl:ConditionalContent runat="server">
    <ContentConditions>
        <SK:PostExtendedAttributeComparison runat="server" ExtendedAttribute="AuthorEmail" Operator="IsSetOrTrue" />                                        
    </ContentConditions>
    <TrueContentTemplate>
        <SK:PostGravatar runat="server" Rating="R" ExtendedAttribute="AuthorEmail" Width="80" BorderWidth="1" />
    </TrueContentTemplate>
    <FalseContentTemplate>
       <SK:Identicon ID="Identicon1" runat="server" width="80" BorderWidth="1" Text="identicon"  />                                      
    </FalseContentTemplate>
</CSControl:ConditionalContent>

This checks to see if the extended attribute "AuthorEmail" is set in the blog comment. If it is set, then we will show the person's Gravatar, otherwise we will show the Identicon.

The WeblogPostFeedbackExtendedAttributeComparison control can be found in the CarKnee Bundle. Remember to register the control as:

<%@ Register TagPrefix="SKB" Namespace="CarKnee.CS.Bundle.Blogs.Controls" Assembly="CarKnee.CS.Bundle" %>

Related Articles:

Published Friday, May 11, 2007 1:51 PM

Comments

# re: ExtendedAttribute Condition Control

Monday, May 14, 2007 10:20 AM by Ben Tiedt

I tried to download the CarKnee Bundle but I keep getting a corrupt ZIP file.  Is HTTPCompression enabled on ASPX pages on your site?  That will corrupt ZIP files being served from the file gallery.

# re: ExtendedAttribute Condition Control

Monday, May 14, 2007 10:44 AM by Sean Kearney

Ben,

I was aware of the possibility that compression could kill zip's, but nobody ever compained for my site!

I have now disabled it for .aspx and you should be good to go.

Thanks.

# Community Server Byte for May 15, 2007

Tuesday, May 15, 2007 10:21 AM by External Feeds

blog bits The CarKnee has been on a tear this week. He released three CS2007 controls, a control to add

# The CarKnee has been on a tear this week

Tuesday, May 15, 2007 10:49 AM by External Feeds

The CarKnee has been on a tear this week. He released three CS2007 controls, a control to add and save

# re: ExtendedAttribute Condition Control

Tuesday, May 15, 2007 10:52 AM by Ben Tiedt

Much better!  Thanks!

# Identicons and Gravatars in Community Server thanks to CarKnee

Monday, June 18, 2007 8:40 PM by andrew @ grr, argh!

I've just gone through and added Identicons and Gravatars to my blog thanks to Sean Kearney's CarKnee

Powered by Community Server (Non-Commercial Edition), by Telligent Systems