Copied to clipboard

Flag this post as spam?

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


  • jools 15 posts 79 karma points
    Dec 03, 2015 @ 11:51
    jools
    0

    Posts on Homepage

    Im trying to get the 3 most recent uBlogsy Posts to appear on a homepage,

    I can get them displaying but just struggling to get the author name to appear with each post. At the moment it just displays the node ID number of each particular author and not their name

    The line in question is: @n.GetProperty("uBlogsyPostAuthor")

    I just need to be able to display the name and not the nodeID

    Any help with this much appreciated.

    Thanks

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 04, 2015 @ 23:30
    Dennis Aaen
    0

    Hi jools,

    Try to use this code below instead.

    @n.GetPropertyValue<string>("uBlogsyAuthorName")
    

    Hope this helps,

    /Dennis

  • jools 15 posts 79 karma points
    Dec 04, 2015 @ 23:57
    jools
    0

    Thanks for the response Dennis, I tried that line of code but when I view the page in browser, I see this error message:

    Error loading Partial View script (file: ~/Views/MacroPartials/uBlogsy/ListPosts.cshtml)

    Doesn't seem to like the

  • Dennis Aaen 4500 posts 18255 karma points admin hq c-trib
    Dec 05, 2015 @ 00:12
    Dennis Aaen
    0

    Hi Jools,

    Okay if you look in this folder \Views\Partials\uBlogsy you can find a file called uBlogsyPostListAuthors this is the file that is used for listing the authors on each post.

    Hope this can help you to get an idea how you can get the author name instead of the id.

    What if you do some thing like this.

    var author = n.GetProperty("uBlogsyPostAuthor");
    
    @author.GetPropertyValue<string>("uBlogsyAuthorName")
    

    /Dennis

Please Sign in or register to post replies

Write your reply to:

Draft