Copied to clipboard

Flag this post as spam?

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


  • MHH311 23 posts 43 karma points
    Oct 18, 2011 @ 03:32
    MHH311
    0

    Displaying Blog content from Blog4Umbraco on Home page

    Ive implemented B4U into a site I am building and am about to create blog entries. However, I dont really need a full page to be the "blog" page as the package is setup. I simply want to have a panel on my home page display all of the blog entries.

    However, the BlogListPosts.xslt that is used on the BLOG page cant be used on other pages due to how it is gathering data in the For-Each statements:

    ------------
    <xsl:for-each select="$currentPage/ancestor-or-self::Blog//BlogPost">

    and

    <xsl:for-each select="$currentPage/ancestor-or-self::Blog//BlogPost [contains(Exslt.ExsltStrings:lowercase(./tags), Exslt.ExsltStrings:lowercase($filter))]">

    ------------

    Has anyone found a way to display the blog entries on another page successfully? Thanks.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 18, 2011 @ 08:38
    Jan Skovgaard
    0

    Hi MHH311

    Let me get this right...

    You just want the blogposts to be viewable on another page and not the blog itself? Or do you want both?

    /Jan

  • MHH311 23 posts 43 karma points
    Oct 18, 2011 @ 14:13
    MHH311
    0

    Jan-

    I would like  all of the info from each blog entry to be viewable on another page within a certain section (div) on my home page ( but I am sure the solution would apply to any page).

    I have found a solution to show Title of each entry and then a link back to the original blog entry but this really isnt what I want. I tried a handful of ways to modify the  BlogListPosts.xslt to pull this info from another page but being new to Umbraco/xslt, I didnt have any success.  Thanks for your help.

  • Jan Skovgaard 11280 posts 23678 karma points MVP 10x admin c-trib
    Oct 18, 2011 @ 23:32
    Jan Skovgaard
    0

    Hi MHH311

    Ok, then you should be able to modify the BlogListPosts.xslt to use a variable containing the source of your blogposts instead of $currentPage.

    try making a variable called "root", which you assign the value of the id of the root of your blogentries.

    Like this: <xsl:variable name="root" select="umbraco.library:GetXmlNodeById('nodeid')" /> - you can see the nodeid by holding the cursor over the node, ind the content tree and view the lower left corner. Or you can simply just click on the node and go go the "properties" section to see the node id.

    Now, instead of $currentPage you should be able to use $root in the xslt file.

    For this to work you also need to go to the macro section and find modify it so that it can be inserted into the rich text editor.

    Then you should be able to insert the macro in any of your pages and be able to view the blog-posts.

    I hope the above explanation makes sense.

    Otherwise just let us know :)

    /Jan

  • MHH311 23 posts 43 karma points
    Oct 24, 2011 @ 00:48
    MHH311
    0

    Jan- your recommendation worked, thanks for the help.

Please Sign in or register to post replies

Write your reply to:

Draft