I have created pagination.html file inside partials. Now I want to implement pagination inside my blogs page. In my blogs page I am having almost 90 cards so for the cards I want to implement pagination. I am having a shortcode called cards I tried implementing pagination but I faced lot of issues. I followed many youtube videos still same issue. So I manually created shortcode call pagination using javascript code. Now pagination is working fine. But issue is when I try to use pagination two times in same page its not working. I think its because of same class and Id. Can any one please tell me the correct way of implementing Hugo pagination to my cards? Please…
If you call .Paginator or .Paginate multiple times on the same page, you should ensure all the calls are identical. Once either.Paginator or .Paginate is called while generating a page, its result is cached, and any subsequent similar call will reuse the cached result. This means that any such calls which do not match the first one will not behave as written.
Hi jmooring Thanks for your reply. I followed same but I am getting issue like – "execute of template failed at <.Page>: can’t evaluate field Page in type string ". I am not able o resolve this issue.
Include a link to the source code repository of your project, because we really need the context of seeing your templates and partials to be able to help you. It is trivial to do a quick git clone on your repo, then run hugo server in your project, to help you out. On the other hand, recreating your code from screenshots, or sort of guessing at it, is not.
If you can’t share your repository for whatever reason, consider creating a dummy repo that you can share, which reproduces the problem you’re experiencing.
Yes jmooring, this is my git repository link…
Note: to run project use “npm run start”. When you click on (http://localhost:1313/), please add “/sg/” in url.
Thank you. I tried 1st option in past its fine when I try to use one time in one page. But its not working when I try two pagination in one page. I think its because of classes conflicts. Can you suggest me how can I use same pagination in single page two times. For example I have two sections like news and events. For news I need one and for Events I need one pagination.