Customizing the ItemStyle.XML to style content queries

On a sharepoint installation I am working on the main homepage is built from a number of content queries which are all configured to use a blog site in the same site collection.  The functionality out of the box is great in terms of filtering which posts appear but a little less so in terms of what the links look like.  To my dismay it appears that the content query web parts completely ignore any CSS overrides and do thier own thing.  In order to style them I found myself editing the itemstyle.xml file which can be found at the root of the site under “Style Library>XSL Style Sheets>ItemStyle.XML”

It is possible to simply edit one of the existing xsl templates within the file however I prefered to copy and paste an existing style template, change its name and then adjust it until I achived the style I wanted.  The benefit of doing it this way is that the existing styles are all preserved.  To use the new style simply select it in the content query web part.  I have attached the additional text I added to the file which creates a new style called “BlogPostBlack”

Make sure to publish a new major version when you are done and if version control is not enabled take a backup of the file before you change it.

 

<xsl:template name=”BlogPostBlack” match=”Row[@Style=’BlogPostBlack’]” mode=”itemstyle”>

        <xsl:variable name=”SafeLinkUrl”>

            <xsl:call-template name=”OuterTemplate.GetSafeLink”>

                <xsl:with-param name=”UrlColumnName” select=”‘LinkUrl’”/>

            </xsl:call-template>

        </xsl:variable>

        <xsl:variable name=”DisplayTitle”>

            <xsl:call-template name=”OuterTemplate.GetTitle”>

                <xsl:with-param name=”Title” select=”@Title”/>

                <xsl:with-param name=”UrlColumnName” select=”‘LinkUrl’”/>

            </xsl:call-template>

        </xsl:variable>

        <div class=”custom_posttitle”>

            <xsl:call-template name=”OuterTemplate.CallPresenceStatusIconTemplate”/>

            <font size=”3?><a style=”font-weight:bold;color:#3B2A31? href=”{$SafeLinkUrl}” title=”{@LinkToolTip}” onClick=”document.getElementById(‘divIDName’).style.color=’#907673?”>

              <xsl:if test=”$ItemsHaveStreams = ‘True’”>

                <xsl:attribute name=”onclick”>

                  <xsl:value-of select=”@OnClickForWebRendering”/>

                </xsl:attribute>

              </xsl:if>

              <xsl:if test=”$ItemsHaveStreams != ‘True’ and @OpenInNewWindow = ‘True’”>

                <xsl:attribute name=”onclick”>

                  <xsl:value-of disable-output-escaping=”yes” select=”$OnClickTargetAttribute”/>

                </xsl:attribute>

              </xsl:if>

              <xsl:value-of select=”$DisplayTitle”/>

            </a>

            </font>

        </div>

                <xsl:variable name=”StartDate”>

                                <xsl:value-of select=”ddwrt:FormatDateTime(string(@PublishedDate), 1033, ‘g’)” />

                </xsl:variable>

                <div class=”custom_date”>

                                <xsl:value-of select=”$StartDate” />

                </div>

                <div class=”custom_description”>

                                <xsl:value-of select=”@Body” disable-output-escaping=”yes” />

                </div>

  </xsl:template>

Sharepoint blog comment text colour css

In my efforts to brand a SharePoint installation with a number of unusual colours I found my self struggling with the comments text on the blog pages. Comments were always being displayed in a light grey which was hard to read against a slightly off white background. To make things worse when a user is creating a comment they have no control over font/colour.  I ended up using the following CSS to force the comments to be displayed in a much darker colour.

H3.ms-CommentHeader {
POSITION: relative; PADDING-BOTTOM: 0px; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; COLOR: #1e1e1e; FONT-SIZE: 1.6em; RIGHT: auto; FONT-WEIGHT: normal; PADDING-TOP: 0px; TOP: -0.25em; LEFT: -2px
}
H4.ms-CommentTitle {
PADDING-BOTTOM: 0px; LINE-HEIGHT: 1.7em; MARGIN: 0px; PADDING-LEFT: 0px; PADDING-RIGHT: 0px; COLOR: #1e1e1e; FONT-SIZE: 8pt; PADDING-TOP: 0px
}
.ms-CommentBody {
PADDING-BOTTOM: 12px; LINE-HEIGHT: 1.7em; WIDTH: 775px; COLOR: #1e1e1e; FONT-SIZE: 8pt; PADDING-TOP: 6px

Exchange 2010 Messages stuck in queue to remote AD site

I have recently been working on implementing a number of new exchange 2010 servers and had an issue where some mail was getting stuck in a queue. For example messages from mailboxes on Server B to mailboxes on Server A end up in one of Server B’s queues called “SMTP Relay to Remote Active Directory Site.” and the last error is 451 4.4.0 Primary Target IP address responded with: “421 4.4.2 Connection dropped.

Now I knew it wasn’t a firewall or network issue as I could telnet into port 25 from each of the servers to each other and sending email in this way also worked. Curiously I couldn’t see anything in the event logs either. The Mail Flow Troubleshooter gives the message ”It appears that the SMTP service and SMTP instance(s) on server A are started but the port did not respond. Check if there are any network errors or hung services.” Also gives “Error submitting mail.” The issue remains after a service and server restart.

The resolution for me was to re-assign the original self signed certificate to the SMTP service instead of the 3rd party CA signed certificate we were using for OWA. (even though it had a valid SAN for the internal FQDN) and then restart the transport service on server A. Once the SMTP service was using the self signed cert all the queued mail was delivered. I hope this helps someone else out there struggling with this issue.