a-ok Posted March 26, 2020 Share Posted March 26, 2020 I'm attempting to set up a 'NEXT PROJECT' link which is based on which category a project is in; so depending if the user accesses the project directly, or from the category page, the 'NEXT PROJECT' link should be based on either the next project in general OR the next project in that category. Projects are all entered under one tree and categories on another then I'm using a pageField to connect them. My question. Is there a way to get the next item (or first if the current item is last) from the current project's position in the pageField? I can get the pageField from the category page (which has all the projects) but I'm struggling to work out how I can find the project's position in that pageField then return either the next or first project in the list. Any thoughts? I tried searching the pageField for the current project but then all that does it return the project as a page and not within the pageField. Thanks in advance. Link to comment Share on other sites More sharing options...
a-ok Posted March 28, 2020 Author Share Posted March 28, 2020 Turns out getNext() works on the pageField whereas next isn’t contextually aware (so it gets the next item in the parent rather than in the pageField) 1 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