Where do I find the Web Parts?

Topics: Enhanced Blog Edition
May 1, 2008 at 7:44 PM
I have installed the CKS enhanced blog edition, but was looking to customize the web parts of the blog. Specifically the apperance (adding a border, changing colors), can anyone direct me to the correct directory and or resources on how to edit the appearance.
Developer
May 1, 2008 at 9:00 PM
You need to download the designer guide from the release page, which should give you a good idea.

The EBE doesn't use WebParts (although you can if you want to)...essentially you need to modify the master page for overall positioning of the controls (<EBE:...../>). Each of the controls uses XSLT to produce the HTML. Modify the .master for overall positions, the individual XSLT for the different 'bits' and the CSS for colors, spacing, etc.

HTH, Vince
May 1, 2008 at 10:31 PM
I need to create a table for displaying the blog posts in a particular way. I'm utilizing background colors, border-bottoms and lefts.....etc. How do I style the XSLT file accordingly? CSS can only help me so much. I've tried containing all styling areas in <div> within the XSLT, but it renders nothing.

It's a complicated language (XSLT) and any bits of assistance would help me greatly! Thanks.
Developer
May 2, 2008 at 10:57 PM
Here is a copy of PostList.xsl which uses a table (badly) to produce the HTML. You can see it here http://cks.wssblogs.com/vince/Home.aspx on the default theme.

It shows where the <table>, <tr> & <td> go.

 
<xsl:stylesheet version="1.0"
	xmlns:date="http://exslt.org/dates-and-times" xmlns:ebe="http://cks/ebemethods"
	xmlns:string="http://exslt.org/strings"
	xmlns:xsl="http://www.w3.org/1999/XSL/Transform" exclude-result-prefixes="date ebe string">
 
	<xsl:param name="IsBlogOwner" />
	<xsl:param name="RelativeUrl" />
	<xsl:param name="QSpageindex" />
	<xsl:param name="TrimPostBodyOnLists"/>
 
	<xsl:output omit-xml-declaration="yes" />
 
	<xsl:template match="/">
 
		<xsl:variable name="endPos" select="number($QSpageindex) * 10"/>
 
		<xsl:choose>
			<!-- Are there any posts -->
			<xsl:when test="count(rows/row) = 0">
				There are no posts in this category
			</xsl:when>
			<!-- Is there a Query String for the page index -->
			<xsl:when test="$QSpageindex">
				<table>
					<xsl:apply-templates select="rows/row[position() &gt; number($endPos)-10 and position() &lt; number($endPos)+1]"/>
				</table>
			</xsl:when>
			<!-- Nope...just show the first 10 -->
			<xsl:otherwise>
				<table>
					<xsl:apply-templates select="rows/row[position() &lt; 11]"/>
				</table>
			</xsl:otherwise>
		</xsl:choose>
 
		<xsl:variable name="pos">
			<xsl:choose>
				<xsl:when test="not($QSpageindex)">1</xsl:when>
				<xsl:otherwise>
					<xsl:value-of select="number($QSpageindex)"/>
				</xsl:otherwise>
			</xsl:choose>
 
		</xsl:variable>
 
		<xsl:if test="number($endPos) &gt; 10">
			<!-- We are on another page...show the previous -->
			<a>
				<xsl:attribute name="href">
					?PageIndex=<xsl:value-of select="number($pos)-1"/>
				</xsl:attribute>
				&lt;&lt; Previous &#160;
			</a>
		</xsl:if>
 
		<xsl:if test="(not($QSpageindex) and count(rows/row) &gt; 10) or (($endPos) and number($endPos) &lt; count(rows/row))">
			<!-- There appear to be more posts...show a 'next' link -->
			<a>
				<xsl:attribute name="href">
					?PageIndex=<xsl:value-of select="number($pos)+1"/>
				</xsl:attribute>
				&#160;Next &gt;&gt;
			</a>
		</xsl:if>
 
 
	</xsl:template>
 
	<xsl:template match="row">
 
		<!-- Use this when you dont want the date stacked 
		<xsl:variable name="publishedDate" select="date:parseDate(PublishedDate, 'yyyy-MM-dd HH:mm:ss')" />
		-->
		<xsl:variable name="publishedDate" select="date:parseDate(PublishedDate, 'yyyy-MM-dd HH:mm:ss')" />
 
		<tr>
		<td>
			<span class="month">
				<xsl:value-of select="date:format-date($publishedDate, 'MMM')"/>
			</span>
			<span class="day">
				<xsl:value-of select="date:format-date($publishedDate, 'dd')"/>
			</span>
		</td>
		<td>
		<div class="content">
			<h1>
				<a title="{Title}" href="{ebe:createPostUrl(PublishedDate, BlogTitleForUrl)}">
					<xsl:value-of select="Title"/>
				</a>
				<xsl:if test="$IsBlogOwner = 'True'">
				<a href="/{substring-after(FileDirRef,'#')}/EditPost.aspx?ID={ID}">
					[Edit Post]
				</a>
			</xsl:if>
			</h1>
 
		<div class="blogcontent">
			<div class="entry">
 
				<xsl:variable name="pureText">
					<xsl:call-template name="removeHtmlTags">
						<xsl:with-param name="html" select="Body" />
					</xsl:call-template>
				</xsl:variable>
 
				<xsl:choose>
					<xsl:when test="$TrimPostBodyOnLists = 'True'" >
						<xsl:value-of select="substring($pureText, 0, 250)" disable-output-escaping="yes" /> ...<span class="small"><a href="{ebe:createPostUrl(PublishedDate, BlogTitleForUrl)}">[Read More]</a></span>
					</xsl:when>
					<xsl:otherwise>
						<xsl:value-of select="Body" disable-output-escaping="yes"/>
					</xsl:otherwise>
				</xsl:choose>
			</div>
		</div>
	
		<!-- close entry post -->
		</div>
		</td>
		<td>
				<div class="small">
					Published: <xsl:value-of select="date:format-date($publishedDate, 'MMM-dd-yy')"/> |
				
					<a href="{ebe:createPostUrl(PublishedDate, BlogTitleForUrl)}">
						<xsl:value-of select="NumComments"/> Comment<xsl:if test="NumComments != 1">s</xsl:if>
					</a>
					|
				<a href="{ebe:createPostUrl(PublishedDate, BlogTitleForUrl)}"><xsl:value-of select="NumLinkbacks"/> Link<xsl:if test="NumLinkbacks!= 1">s</xsl:if> to this post</a>
 
				</div>
		</td>
		</tr>
		<!-- close div content -->
	</xsl:template>
 
	<xsl:template name="removeHtmlTags">
		<xsl:param name="html"/>
		<xsl:choose>
			<xsl:when test="contains($html, '&lt;')">
				<xsl:value-of select="substring-before($html, '&lt;')"/>
				<xsl:call-template name="removeHtmlTags">
					<!-- Recurse through HTML -->
					<xsl:with-param name="html" select="substring-after($html, '&gt;')"/>
				</xsl:call-template>
			</xsl:when>
			<xsl:otherwise>
				<xsl:value-of select="$html" />
			</xsl:otherwise>
		</xsl:choose>
	</xsl:template>
 
</xsl:stylesheet>
 

HTH, Vince