I create a page with a shiver where I need to know the previous and next sister of the current page:
In my portrait page model, I tried to define two methods to find the correct URLs, but I missed the important part. To get the first brother, I can simply do the following:
class PortraitPage(Page):
...
def first_portrait(self):
return self.get_siblings().live().first().url
There is a method first()and last(), but it seems, the method is next()either previous()not used to get direct neighbors (in the order in which they are located in the wagtail administrator).
Is there any way to achieve this?
source
share