On each page I would like to get the next page and link to it, even if it's in the next chapter - but not if it's in the next book.
I have managed to make it work in XSLT with below selector (though it still goes in to next book, but I will deal with that later). But can anyone tell me how to get the next Page with Razor?
Get following Page in some chapter
I am looking for a way to browse pages in a book made from umbraco nodes.
It has this structure
Book 1
--Chapter 1
----Page 1
----Page 2
----Page ...
--Chapter 2
----Page 1
----Page ...
Book 2
--Chapter 1
----Page 1
----Page...
On each page I would like to get the next page and link to it, even if it's in the next chapter - but not if it's in the next book.
I have managed to make it work in XSLT with below selector (though it still goes in to next book, but I will deal with that later). But can anyone tell me how to get the next Page with Razor?
@Model.Next("Page") seems to only work within a chapter.
Thanks, Simon K
bump. Any Razor guns out there?
Hi Simon,
You could simply parse your way through the tree with .Up(1); Next(1); etc etc. You could also just get all of the pages in a collection by:
.. and then find the next page in the collection :-)
Or, you could go for an XPath expression:
The above code-snippets are untested, though.
Let me know how it turns out :-)
- Bo
is working on a reply...