Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Streety 358 posts 568 karma points
    Sep 11, 2009 @ 10:47
    Streety
    0

    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

    Sep 11, 2009 @ 11:30

    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).

  • Streety 358 posts 568 karma points
    Sep 11, 2009 @ 12:20
    Streety
    0

    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.

Please Sign in or register to post replies

Write your reply to:

Draft