Copied to clipboard

Flag this post as spam?

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

  • Matthew Jarvis 129 posts 129 karma points
    Dec 06, 2011 @ 16:24
    Matthew Jarvis

    Homepage of Blog to act as preview

    Absolutely love this package, my fav I think I've used for Umbraco.

    Basically what I am trying to achive is as the title suggests for the landing homepage of my Blog to act as a preview and not to display articles as they are created on their respective page.

    For example....

    I have 5 posts on my blog, all of these posts contain 300 words and 5 images. Individually these posts look great, the images and 300 words look nice. 

    However the hompage of my blog at the moment displays latest posts as they are created and featured on individual pages.

    To sum up, what I am looking for is:-

     - The ability to set a word limit on the homepage so that only 100 words say are shown per article

     - The ability for images to be resized a lot smaller on the homepage say 25% of original size (This at the moment is my biggest issue that I need resolving)

  • Stephen 204 posts 246 karma points
    Dec 06, 2011 @ 16:30

    Yes this can be would need to write some of your own XSLT or Razor to achieve it...

    The follwing code could be adapted to limit the copy..

    <?xml version="1.0" encoding="UTF-8"?>
    <!DOCTYPE xsl:stylesheet [
        <!ENTITY nbsp "&#x00A0;">
      exclude-result-prefixes="msxml umbraco.library">

        <xsl:output method="xml" omit-xml-declaration="yes"/>

        <xsl:param name="currentPage"/>
    <xsl:param name="MaxNoChars" select="190" />
    <xsl:template match="/">

      <xsl:for-each select="$currentPage//ancestor-or-self::doTextpage[@isDoc and showOnHomepage = '1']">     
      <div class="redPanel">
        <h2><xsl:value-of select="@nodeName" /></h2>
        <p><xsl:value-of select="umbraco.library:TruncateString(umbraco.library:StripHtml(umbraco.library:Replace(current()/bodyText, '&amp;nbsp;', '')), $MaxNoChars, '...')" /></p>
        <p><a href="{umbraco.library:NiceUrl(@id)}"> <img src="/img/btnMore.png" alt="read more" tooltip="Read more" align="right" /> </a></p>



    As for any images i would use ImageGen to change the size, i think might even be used already by ublogsy...hope this helps.


  • Matthew Jarvis 129 posts 129 karma points
    Dec 06, 2011 @ 16:53
    Matthew Jarvis

    Thanks for your reply Stephen, before trying to implement something I'll see if someone has achieved this specifically with UBlogsy before I start editing files.

    Many Thanks

  • Stephen 204 posts 246 karma points
    Dec 06, 2011 @ 17:01

    If it were me i would make copies of the files you want to change so you can always go back to the ublogsy "out the box" versions...then edit the copied versions to do what you want...either way your going to need to write code to get what you want.



Please Sign in or register to post replies

Write your reply to: