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
    0

    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
    Stephen
    0

    Yes this can be done..you 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;">
    ]>
    <xsl:stylesheet
      version="1.0"
      xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
      xmlns:msxml="urn:schemas-microsoft-com:xslt"
      xmlns:umbraco.library="urn:umbraco.library"
      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>
        </div>
        </xsl:for-each>

    </xsl:template>

    </xsl:stylesheet>

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

    S


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

    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
    Stephen
    0

    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.

    Cheers,

    S

Please Sign in or register to post replies

Write your reply to:

Draft