Picture of Henrik Aabom
Drawer Navigation to sub-pages
by Henrik Aabom - Wednesday, 14 September 2016, 12:39 PM
 

Hi good Adapt folks

Can anyone tell me how to get the id's of pages on a sub menu through handlebars?

In the adapt-contrib-drawerPageNavigation the code:

{{#each resources}}

runs through all pages and submenues in the main menu. 

https://github.com/theodi/adapt-contrib-drawerPageNavigation/blob/master/templates/contentObjects.hbs

But where does the {{resources}} refere to? I can't seem to figure it out.

 

Basically I want to expand on the adapt-contrib-drawerPageNavigation so that it also displays pages on submenues, which it doesn't as it is now.

 

Any ideas on how this could be achieved will be much appreciated!

Picture of Matt Leathes
Re: Drawer Navigation to sub-pages
by Matt Leathes - Wednesday, 14 September 2016, 3:49 PM
 

Looking at the code, the function setupMenu in adapt-contrib-drawerPageNavigation.js creates a Backbone Collection of all the items to be displayed which it then passes to the DrawerPageNavigationView - this is then passed in to the handlebars template as a property named resources in this line.

Hope this helps

Picture of Henrik Aabom
Re: Drawer Navigation to sub-pages
by Henrik Aabom - Friday, 16 September 2016, 7:03 AM
 

Ah I get it now. Thanks Matt!