ExtendedAttribute Condition Control
2007-05-11 | Community Server CarKnee BundleI was working a new control for the 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 bundle. Remember to register the control as:
<%@ Register TagPrefix="SKB" Namespace="CarKnee.CS.Bundle.Blogs.Controls" Assembly="CarKnee.CS.Bundle" %>
Related Articles:
Comments
2007-05-14T22:20:00.0000000Z
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.
2007-05-14T22:44:41.0000000Z
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.
2007-05-15T22:52:38.0000000Z
Much better! Thanks!