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?
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?
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?
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?
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.
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?
I'm not sure what you mean. Can you give an example?
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
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 :)
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!
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.
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.
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!
Hey Anthony, any thoughts on my question above?
You shouldnt need the dlls for just pagination.
Try this instead:
url = url.Replace("page", (page - 1).ToString());
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.
is working on a reply...