Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Link to show older navigation button is not getting visible #142

Open
dev8546 opened this issue Mar 23, 2020 · 1 comment
Open

Link to show older navigation button is not getting visible #142

dev8546 opened this issue Mar 23, 2020 · 1 comment

Comments

@dev8546
Copy link

dev8546 commented Mar 23, 2020

I have seen that if we go beyond the page per blog. Older navigation option does not appear. The reason what I found is to do with this code

int pageCount; pageCount = int.TryParse(ViewData[Constants.TotalPostCount].ToString(), out pageCount) ? 0 : pageCount / 2;

Here we can see if TryParse is true, pageCount is always getting set to 0. Not sure what is that way and even what is the logic behind putting the hard coded value of 2 in pageCount/2.

This is the code what I think should work
int pageCount; pageCount = int.TryParse(ViewData[Foodzy.Utility.Blog.Constants.TotalPostCount].ToString(), out pageCount) ? (pageCount - 1) / settings.Value.PostsPerPage : 0;

@BizTron
Copy link

BizTron commented Feb 19, 2021

//pageCount = int.TryParse(ViewData[Constants.TotalPostCount].ToString(), out pageCount) ? 0 : pageCount / 2;
pageCount = int.TryParse(ViewData[Constants.TotalPostCount].ToString(), out pageCount) ? (pageCount - 1) / settings.Value.PostsPerPage : 0;

Thanks. I implemented this and it appears to work now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants