vxda Posted April 8, 2014 Share Posted April 8, 2014 Hi, im making a website with alot of articles, my structure looks like thisNEWS CATEGORY article item CATEGORY article item CATEGORY article item CATEGORY article item CATEGORY On home page im listing all articles from all categories - 25 articles per page. Im opening them in FancyboxInsite article i have next and previous buttons, on click im loading content of article via ajax, replacing content in fancybox. and i change history via history api for seo reasons.My question is:Is there a way to make next and prev buttons change thru articles but listed on my home page (included next pages) instead of picking next or prev from category the article is nested in ? Would be grateful for some tips on that. Cheers 1 Link to comment Share on other sites More sharing options...
SiNNuT Posted April 8, 2014 Share Posted April 8, 2014 Something like?: //populate a PageArray $articleList = $pages->find("template=article, limit=25") //next $page->next($articleList) //prev $page->prev($articleList) This assumes your articles have their own template. You can put more options, like sort, in the page selector. The http://cheatsheet.processwire.com/ is always a nice thing to check for options available. 2 Link to comment Share on other sites More sharing options...
diogo Posted April 8, 2014 Share Posted April 8, 2014 prev and next look for a the prev and next pages inside any pageArray, if you use it with the same array that you used to build your posts list, it will respect that order. 1 Link to comment Share on other sites More sharing options...
vxda Posted April 8, 2014 Author Share Posted April 8, 2014 prev and next look for a the prev and next pages inside any pageArray, if you use it with the same array that you used to build your posts list, it will respect that order. Yes i noticed that, its all good i want ot use that but only when inside category. On home page i want to be able to click next nad prev and stay within "home page array", Something like?: //populate a PageArray$articleList = $pages->find("template=article, limit=25") //next $page->next($articleList) //prev $page->prev($articleList) This assumes your articles have their own template. You can put more options, like sort, in the page selector. The http://cheatsheet.processwire.com/ is always a nice thing to check for options available. I think thats what i was looking for i will test it once im back from work. Thank alot, as allways i can count on your help here. thx very much !! Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now