Copied to clipboard

Flag this post as spam?

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


  • Sam Pearson 36 posts 89 karma points
    Mar 09, 2011 @ 15:54
    Sam Pearson
    0

    Filtering blog posts by author via Blog 4 Umbraco

    Hi all,

    I'm a bit of a newb to XSLT and have been creating a company blog using blog 4 umbraco. I would like to know how to create a list on the blog page that enables the user to view all posts by a single author.

    Ideally it would look the same as the tags/categories list with each entry displaying a number representing the amount of posts available.

    I have looked around the forum and can't find anything similar, any help is appreciated.

    Just for reference I'm using Umbraco 4.6.1 with Blog4Umbraco 2.0.26.

    Cheers

  • Sam Pearson 36 posts 89 karma points
    Mar 10, 2011 @ 13:46
    Sam Pearson
    0

    Any takers?

  • Sam Pearson 36 posts 89 karma points
    Mar 29, 2011 @ 11:07
    Sam Pearson
    0

    Does anybody have any solutions to this please guys? It's proving quite hard finding info/help on this issue.

  • Jeroen Breuer 4909 posts 12266 karma points MVP 5x admin c-trib
    Mar 29, 2011 @ 11:31
    Jeroen Breuer
    0

    You could create an xslt extension in which you use Linq2Umbraco to fetch the correct data. Here is a start:

    public static XPathNodeIterator GetBlogData(int id)
    {
    BlogPost post =
    (
    from blogPost in UmbracoDataContext.BlogPosts
    where blogPost.CreatorID == id
    select blogPost
    ).Single();

    //TODO convert data into XPathNodeIterator. Something like this:
    //XDocument index = new XDocument(
    // new XDeclaration("1.0", "utf-8", "yes"),
    // new XComment("Return the data of an blog"),
    // new XElement("blog",
    // new XElement("title", post.Title),
    // new XElement("text", post.Text)
    // )
    // );

    //return index.CreateNavigator().Select("/blog");
    }

    Jeroen

  • Sam Pearson 36 posts 89 karma points
    Mar 29, 2011 @ 12:38
    Sam Pearson
    0

    Thanks for your reply Jeroen, I will have a look into creating the list using this method.

    Is creating a new umbraco extension essential for this type of function? or is it possible to do this with the existing blog4umbraco setup using a customised XSLT file?

    Apologies for my ignorance, but I'm a front-end designer who has been tasked with quite a few back-end development jobs on this project.

     

     

  • 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