Umbraco Blog App - Modify BlogListPosts.xslt so that homepage posts are limited
Hello,
Would it be possible to modify the BlogListPosts.xslt file so that is only shows a few lines of the blog post. It currently shows the whole post.This is more inline with how other bloggers work.
You could add a new property to the blog post document type called "introduction" that you would fill up with a small snippet. Then in the BlogListPosts.xslt replace the content property with the introduction property.
Or you could only show a substring of the content property using the xpatth substring function (http://www.zvon.org/xxl/XSLTreference/Output/function_substring.html).
Umbraco Blog App - Modify BlogListPosts.xslt so that homepage posts are limited
Hello,
Would it be possible to modify the BlogListPosts.xslt file so that is only shows a few lines of the blog post. It currently shows the whole post.This is more inline with how other bloggers work.
Could you give me an idea where to start?
Best regards.
Comment author was deleted
Hi,
There are several ways this can be done:
You could add a new property to the blog post document type called "introduction" that you would fill up with a small snippet. Then in the BlogListPosts.xslt replace the content property with the introduction property.
Or you could only show a substring of the content property using the xpatth substring function (http://www.zvon.org/xxl/XSLTreference/Output/function_substring.html).
Hi Tim,
Yes that works. Small correction the Content property is refered to the alias in the XLST file so you are looking for this line:
<xsl:value-of select="$post/data [@alias = 'snippet']" disable-output-escaping="yes"/>
more... <a href="{umbraco.library:NiceUrl($post/@id)}"><xsl:value-of select="$post/@nodeName"/></a>
I changed the existing value of "bodyText" which is the alias of Content to snippet and included a link to view the whole post. It seems to work.
Thanks again.
is working on a reply...