Copied to clipboard

Flag this post as spam?

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


  • Chris Davis 56 posts 74 karma points
    Jul 25, 2012 @ 21:17
    Chris Davis
    0

    Get next/previous 10+ posts on landing page

    Great package.

    Is there a way to get the next/previous 10 posts (or however many are displaying) on the landing page, similar to the next/previous links on each Post page?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 26, 2012 @ 01:37
    Anthony Dang
    0

    I'm not sure what you mean. Can you give an example?

     

  • Chris Davis 56 posts 74 karma points
    Jul 26, 2012 @ 02:10
    Chris Davis
    0

    If you go to a blog post there's an "Older Posts" and "Newer Posts" link near the bottom which takes you to the next post (by date) or to the previous post.

    On the blog home page, or landing page, you can display "x" number of the most recent posts. Is there a way to add similar "Older Posts" and "Newer Posts" links, like that from a blog post page, to the blog home page?

    So, if there's 10 posts showing up on the home page I need a link at the bottom that says "Newer Posts" (or whatever) that will retreive the next 10 most recent posts. Then, you will see the "Older Posts" link along with the "Newer Posts" link to view the previous or next 10 posts. Make sense?

    Thanks for the help!

    Chris

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 27, 2012 @ 20:12
    Anthony Dang
    0

    Ah.

    So basically you want the functionality of the pagination without the page numbers.

    Just take the pagination code, comment out the page number links. It's as easy as that :)

     

     

  • Chris Davis 56 posts 74 karma points
    Jul 27, 2012 @ 22:15
    Chris Davis
    0

    I'm not seeing any page number links, either on the site or in the code.

    The pagination on a post page only gets the next or previous post. If the home page contains 10 posts for example, will the pagination code retrieve the next 10 or just the next 1?

    Thanks for the help!

  • Chris Davis 56 posts 74 karma points
    Jul 27, 2012 @ 22:38
    Chris Davis
    0

    Anthony,

    I should have clarified before but I'm using version 1.3.6.1. I did not realize the new version already has this functionality!

    Is it best to upgrade uBlogsy to get this feature or can I incorporate it into my current version?

    Thanks again.

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Jul 30, 2012 @ 12:01
    Anthony Dang
    0

    Upgrading really depends on how many of the new features you want, vs how much time you have to upgrade.

    Upgrade from 1.3.6.1 to 2.0 is a big leap and will be very manual as a bunch of stuff has changed.

    If all you want is some pagination then I would copy the code from the new version, and put it in yours.

     

  • Chris Davis 56 posts 74 karma points
    Jul 31, 2012 @ 16:58
    Chris Davis
    0

    Thanks Anthony,

    I found the pagination function in the "uBlogsyListPosts.cshtml" file but I'm getting the following error when I save:

    'string' does not contain a definition for 'ReplaceQueryStringItem' and no extension method 'ReplaceQueryStringItem' accepting a first argument of type 'string' could be found (are you missing a using directive or an assembly reference?)

    Here's the code causing the issue:
    string url = Request.Url.ToString();
    url = url.ReplaceQueryStringItem("page", (page - 1).ToString());

    Do I need to replace a DLL, or is that going to cause issues?

    Thanks!

  • Chris Davis 56 posts 74 karma points
    Aug 06, 2012 @ 17:48
    Chris Davis
    0

    Hey Anthony, any thoughts on my question above?

  • Anthony Dang 1404 posts 2558 karma points MVP 3x c-trib
    Aug 08, 2012 @ 11:07
    Anthony Dang
    0

    You shouldnt need the dlls for just pagination.

     

    Try this instead:

    url = url.Replace("page", (page - 1).ToString());

     


     

  • Chris Davis 56 posts 74 karma points
    Aug 10, 2012 @ 22:52
    Chris Davis
    0

    It's now looking for the "postCount" variable when I call the function. I copied over the variable "int postCount = PostService.Instance.GetPosts(Model.Id, tag, category, author, searchTerm, commenter, 0, int.MaxValue).Count;" but it's now failing on "PostService", as it does not exist in the context.

    Thanks.

Please Sign in or register to post replies

Write your reply to:

Draft