Muut Archive Legend
@Muut · Joined 9 years ago · 18337 posts · 3878 topics · 137 reputation
Badges
Recent posts
-
Looping through pages on same level
· 10 years ago
Ok I'll just have to break down and actually try this. :)
-
Looping through pages on same level
· 10 years ago
I tried {{ dump(page.parent.children.remove(page.path)) }}, but it didn't give me a siblings array. How can I get page.siblings to work, or loop through all the pages on one level?
-
Looping through pages on same level
· 10 years ago
ugg.. Page.siblings() is not a valid function. it's actually a method on the Collection object. Bit hackish but you can do: {{ dump(page.parent.children.remove(page.path)) }}
-
Looping through pages on same level
· 10 years ago
The console says "null" when I do a {{ dump(page.siblings) }}.
-
Looping through pages on same level
· 10 years ago
try enabling debug and add a {{ dump(page.siblings) }} you should see the pages array in debug bar. dont forget to clear cache
-
Looping through pages on same level
· 10 years ago
Thanks for the reply, but still no items are showing up in the navbar :\
-
Looping through pages on same level
· 10 years ago
you are using same variable page for item and array, try this: {% for p in page.siblings %} {% if p.visible %} <li><a href="{{ p.url }}">{{ p.menu }}</a></li&g
-
Looping through pages on same level
· 10 years ago
page.siblings is not working either. I have also tried pages.siblings :(
-
Looping through pages on same level
· 10 years ago
Should be just page.siblings not page.self.siblings .. try that..
-
Looping through pages on same level
· 10 years ago
Thanks for the response! However, this only shows the children of the current page, not the pages on the same level.