Navigate from ancestors[1]

9 views
Skip to first unread message

Dimitris Zervas

unread,
Apr 14, 2016, 4:50:30 PM4/14/16
to apostrophenow
Hello,

I want to navigate based on ancestors[1].
Actually I just want to get all the children of page.ancestors[1].
How can I do inside afterInit? (or directly with nunjucks?)

Tom Boutell

unread,
Apr 14, 2016, 5:30:49 PM4/14/16
to apostr...@googlegroups.com
It's a lot easier than that (:

In your apostrophe-site configuration:

pages: {
  ... other options for pages ...
  ancestorOptions: {
    depth: 2
  }
}

Now each ancestor has a "children" property which is an array as you'd hope.

--
You received this message because you are subscribed to the Google Groups "apostrophenow" group.
To unsubscribe from this group and stop receiving emails from it, send an email to apostropheno...@googlegroups.com.
For more options, visit https://groups.google.com/d/optout.



--


THOMAS BOUTELL, DEV & OPS
P'UNK AVENUE | (215) 755-1330  |  punkave.com

Dimitris Zervas

unread,
Apr 15, 2016, 1:48:42 PM4/15/16
to apostr...@googlegroups.com
OOOOH! :)
(I'd be glad if you document your glorious work man...)

Thanks!
--
Sent from my Android device with K-9 Mail. Please excuse my brevity.

Tom Boutell

unread,
Apr 15, 2016, 1:50:05 PM4/15/16
to apostr...@googlegroups.com
This is helpful:


But doesn't currently mention ancestorOptions.

(And it's not just me! Most of the 0.6 work is coming from Jimmy and Matt C. at the moment.)
Reply all
Reply to author
Forward
0 new messages