Saturday, February 22, 2014

Dynamic menu content in layout

What I'm trying to do is to put two dynamic navigation menus in my CakePHP layout (default.ctp). The main menu should have multiple levels (with a dropdown functionality). The secondary menu is the one that shows the dropdown content of the main menu in a left sidebar.

I've read the CakePHP documentation but I'm confused how to fit those menus in the layout. I know that you have 4 different parts in a view layer (as documented in http://book.cakephp.org/2.0/en/views.html):

  • views
  • elements
  • layouts
  • helpers

But with the knowledge I have right now, I think none of this parts can be used to fill my needs. A navigation menu is a part that you only load ONES in a layout, so it isn't an element or a helper. So what's the best practice...

  • ... where to create the menu tree?
  • ... where / how to echo it in the layout file?

Can anybody clearify my issue? Thanks in advance! ;)

--
Like Us on FaceBook https://www.facebook.com/CakePHP
Find us on Twitter http://twitter.com/CakePHP
 
---
You received this message because you are subscribed to the Google Groups "CakePHP" group.
To unsubscribe from this group and stop receiving emails from it, send an email to cake-php+unsubscribe@googlegroups.com.
To post to this group, send email to cake-php@googlegroups.com.
Visit this group at http://groups.google.com/group/cake-php.
For more options, visit https://groups.google.com/groups/opt_out.

No comments: