Copied to clipboard

Flag this post as spam?

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


  • Anthony Candaele 1197 posts 2049 karma points
    Aug 14, 2011 @ 16:22
    Anthony Candaele
    0

    n word preview on blog landing page

    Hi,

    I have just published my second blog post on http://www.webmove.be/home/blog and noticed that the blog landing page / or homepage, is getting a bit long.

    I have read a blogpost on CogBlog about a way to show only an excerpt of a blogpost on the blog homepage:

    http://thecogworks.co.uk/blog/2011/1/21/n-word-preview-for-blog4umbraco

    This might also be a good idea for the uBlogsy package.

    greetings,

    Anthony Candaele

  • Lee Kelleher 4020 posts 15802 karma points MVP 13x admin c-trib
    Aug 15, 2011 @ 15:54
    Lee Kelleher
    1

    Hi Anthony,

    (I have nothing to do with uBlogsy - just throwing in other suggestions)

    The CogWorks blog post is great for when you need to keep the HTML intact within the summary/preview text. The code can actually be used standalone from Blog4Umbraco and uBlogsy - so there's nothing to stop you from using that solution.

    Alternatively, if you are not concerned with the HTML in the summary, here are a couple of other suggestions:

    Using native extensions from "umbraco.library":

    <xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHtml(bodyText), 150, '...')"/>

    or if you happen to be using uComponents, then you could use a Strings extension?

    <xsl:value-of select="ucomponents.strings:GetFirstWords(bodyText, 30, '...')"/>
    
    Cheers, Lee
  • Anthony Candaele 1197 posts 2049 karma points
    Aug 15, 2011 @ 16:28
    Anthony Candaele
    0

    Hi Lee,

    Thanks for the advice. As preservation of the HTML is not my concern, the alternative solution you are suggesting, using the umbraco.library method, or the uComponents Strings extension sound great. I'll give it a try.

    Greetings,

    Anthony Candaele

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Aug 30, 2011 @ 23:52
    Anthony Dang
    0

    You could just use jquery to hide elements in the post container... everything is classed so it's super easy.

     

Please Sign in or register to post replies

Write your reply to:

Draft