I installed blog4umbraco, and it works fine, but I would like that the blogpost could be shown on the frontpage of my website. I have tried all kind of stuff. adding the blogListPost.xslt to my frontpage template etc.. but no data show. I can make categories show, but not the post.. What am I doing wrong??
I tried to implement your xslt macro on my website, but it is not working. The only difference in my site structure is that the blog node is a child of a homepage node, like this:
As you can see on the screenshot I have a document type 'dv blog' that is a child of the document type 'dv homepage'.
So I guess I have to adjust the XPath axis in your code:
blog4umbraco
hi
I installed blog4umbraco, and it works fine, but I would like that the blogpost could be shown on the frontpage of my website. I have tried all kind of stuff. adding the blogListPost.xslt to my frontpage template etc.. but no data show. I can make categories show, but not the post.. What am I doing wrong??
I have done this on my own site. You will need to create a new xslt macro, something like this:
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [ <!ENTITY nbsp " "> ]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library" xmlns:Exslt.ExsltCommon="urn:Exslt.ExsltCommon" xmlns:Exslt.ExsltDatesAndTimes="urn:Exslt.ExsltDatesAndTimes" xmlns:Exslt.ExsltMath="urn:Exslt.ExsltMath" xmlns:Exslt.ExsltRegularExpressions="urn:Exslt.ExsltRegularExpressions" xmlns:Exslt.ExsltStrings="urn:Exslt.ExsltStrings" xmlns:Exslt.ExsltSets="urn:Exslt.ExsltSets" xmlns:tagsLib="urn:tagsLib" xmlns:BlogLibrary="urn:BlogLibrary"
exclude-result-prefixes="msxml umbraco.library Exslt.ExsltCommon Exslt.ExsltDatesAndTimes Exslt.ExsltMath Exslt.ExsltRegularExpressions Exslt.ExsltStrings Exslt.ExsltSets tagsLib BlogLibrary ">
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
<xsl:template match="/">
<xsl:for-each select="$currentPage/ancestor::root//node [@nodeTypeAlias = 'BlogPost']">
<xsl:sort select="@createDate" order="descending" />
<xsl:if test="position()=1">
<h3><xsl:value-of select="@nodeName"/></h3>
<h4>on <xsl:value-of select="umbraco.library:FormatDateTime(@createDate, 'dd MMM yyyy')"/></h4>
<xsl:value-of select="./data [@alias = 'bodyText']" disable-output-escaping="yes"/>
</xsl:if>
</xsl:for-each>
</xsl:template>
</xsl:stylesheet>
thanks. I'll take that code for a spin, when I come home
It works perfectly thanks
Hi Paul,
I tried to implement your xslt macro on my website, but it is not working. The only difference in my site structure is that the blog node is a child of a homepage node, like this:
As you can see on the screenshot I have a document type 'dv blog' that is a child of the document type 'dv homepage'.
So I guess I have to adjust the XPath axis in your code:
<xsl:for-each select="$currentPage/ancestor::root//node [@nodeTypeAlias = 'BlogPost']">
But I tried all kinds of combinations like
<xsl:for-each select="$currentPage/DVBlog//node[@nodeTypeAlias = 'DVBlogPost']">
but that doesn't work.
Help would be much appreciated,
Anthony Candaele
Belgium
is working on a reply...