Skip to content

New customizable version of BlogThisUsingPostXINGPlugin available

Tue Jan 04 2005

This new version of the BlogThisUsingPostXINGPlugin handles customizing the transform used to output into a new Post in PostXING. For example, say I want to have the title of the post referenced in the post body. I would start off with the LinkOnly.xslt option:

  1 <?xml version="1.0" ?>
  2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 	<xsl:output method="html" /> 
  4 	<xsl:variable name="feed-title" select="/rss/channel/title" />
  5 	
  6 	<xsl:template match="/">
  7 		<xsl:apply-templates select="//item" />
  8 	</xsl:template>
  9 
 10 	<xsl:template match="/rss/channel/item">
 11 		<html>
 12 		<title>RE: <xsl:value-of select="title" /></title>
 13 		<xsl:choose><xsl:when test="link"><a href="{link}"><xsl:value-of select="$feed-title" /></a></xsl:when><xsl:otherwise><xsl:value-of select="$feed-title" /></xsl:otherwise></xsl:choose>
 14 		</html>
 15 	</xsl:template>
 16 </xsl:stylesheet>

Line 13 is the key line. All I did was change the use of xsl:variable to the actual title that is context-specific in this case. So we now have:

  1 <?xml version="1.0" ?>
  2 <xsl:stylesheet version="1.0" xmlns:xsl="http://www.w3.org/1999/XSL/Transform">
  3 	<xsl:output method="html" /> 
  4 	<xsl:variable name="feed-title" select="/rss/channel/title" />
  5 	
  6 	<xsl:template match="/">
  7 		<xsl:apply-templates select="//item" />
  8 	</xsl:template>
  9 
 10 	<xsl:template match="/rss/channel/item">
 11 		<html>
 12 		<title>RE: <xsl:value-of select="title" /></title>
 13 		<xsl:choose><xsl:when test="link"><a href="{link}"><xsl:value-of select="title" /></a></xsl:when><xsl:otherwise><xsl:value-of select="title" /></xsl:otherwise></xsl:choose>
 14 		</html>
 15 	</xsl:template>
 16 </xsl:stylesheet>

Subtle difference, but it changes a post from this:

Frans Bouma's blog

to this:

Template Studio for LLBLGen Pro released!

I only left the three default options for formatting in there with the idea that most of the time, I would only want to use one of these anyways. This opens up the door for this plugin to be completely customized, to where the descriptions don't mean anything for the content of the actual transform.

[ Currently Playing : Killer Is Me - Alice in Chains - Unplugged (5:23) ]

💾 May the source be with you. v3.2.1220