Monthly Archives: September 2010

Resources for Using WordPress as a CMS

  1. http://www.idesignstudios.com/blog/web-design/wordpress-as-cms/
  2. http://www.noupe.com/wordpress/powerful-cms-using-wordpress.html
  3. http://wparena.com/how-to/wordpress-plugins-that-extend-cms-functionality/
  4. http://justintadlock.com/archives/2010/02/02/showing-custom-post-types-on-your-home-blog-page
  5. http://wordpress.org/extend/plugins/custom-post-type-ui/ (Custom Post-Type plugin, quick start-up than Pods, flutter, & CMS Press plugins)
  6. WordPress Optimization:  http://ithemes.com/how-to-optimize-wordpress-in-7-steps/
  7. General Collection of WP HowTOs:  http://wordpresscms.ithemes.com/resources/how-tos/
  8. http://publisherblog.automattic.com/2010/01/19/wordpress-cms-wnet-org/
  9. Designer Friendly Plugins:  http://wpmu.org/stylish-plugin-sampler-15-design-friendly-plugins-for-your-wordpress-site/
  10. Edit-Flow Plugin. http://wordpress.org/extend/plugins/edit-flow/

Customizing the CQWP for Displaying Calendar Information

I was recently asked to display event information from a SharePoint (MOSS 2007 ) calendar in the following format:

Event Name

MM/D, hh:mm -  hh:mm

To get started, I read through Heather Solomon’s blog post on Customizing the Content Query Web Part and Custom Item Styles. I then read through this UK SharePoint group post, about adding the DDWRT namespace to the XSL styles sheet, which helped me figure out the necessary date and time transformations.  I also referenced this MSDN article on the functions in ddwrt namespace.

I modifed the Content Query Web Part as follows:

<property name=”CommonViewFields” type=”string”>EventDate,DateTime;EndDate,DateTime</property>

<property name=”DataColumnRenames” type=”string”>EventDate,DateTime;EndDate,DateTime</property>

I then Modifed the /Style Library/XSL Style Sheets/ItemStyle.xsl to include the following XSL Template:

<xsl:template name=”CenterCalendar” match=”Row[@Style='CenterCalendar']” mode=”itemstyle”>
<xsl:variable name=”SafeImageUrl”>
<xsl:call-template name=”OuterTemplate.GetSafeStaticUrl”>
<xsl:with-param name=”UrlColumnName” select=”‘ImageUrl’”/>
</xsl:call-template>
</xsl:variable>
<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>
<xsl:variable name=”LinkTarget”>
<xsl:if test=”@OpenInNewWindow = ‘True’” >_blank</xsl:if>
</xsl:variable>
<div id=”linkitem”>
<xsl:if test=”string-length($SafeImageUrl) != 0″>
<div>
<a href=”{$SafeLinkUrl}” target=”{$LinkTarget}”>
<img src=”{$SafeImageUrl}” alt=”{@ImageUrlAltText}”/>
</a>
</div>
</xsl:if>
<div>
<xsl:call-template name=”OuterTemplate.CallPresenceStatusIconTemplate”/>
<a href=”{$SafeLinkUrl}” target=”{$LinkTarget}” title=”{@LinkToolTip}”>
<xsl:value-of select=”$DisplayTitle”/>
</a>
<div>
<xsl:value-of select=”@Description” />
</div>
</div>
</div>
<div>
<xsl:value-of select=”ddwrt:FormatDateTime(string(@EventDate) ,1033 ,’dddd MM/dd/yyyy h:mm tt’)” />
-
<xsl:value-of select=”ddwrt:FormatDateTime(@EndDate ,1033 ,’ h:mm tt’)” />
</div>

</xsl:template>

The resulting CQWP looks like this, & is missing the start time:

Event #1
- 3:00 PM
Event #2
- 6:00 PM