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

  • Tim Geyssens 6562 posts 15373 karma points MVP 2x c-trib
    Sep 11, 2009 @ 11:30
    Tim Geyssens
    0

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

  • This forum is in read-only mode while we transition to the new forum.

    You can continue this topic on the new forum by tapping the "Continue discussion" link below.

Please Sign in or register to post replies