Get Navigation Menu as an Array or Object

edited March 2011 in Modules
I know I can use fuel_nav to get the html of my menu. Is there a function that returns my navigation menu as a nested array or object of some sort? My navigation is multilevel, something like this:
level0_item_a level1_item_a level1_item_b level0_item_b level1_item_c level2_item_a level2_item_b level1_item_d level1_item_e level0_item_c level0_item_d
Is there a function to return that tree structure? Or even better, is there a way to get an array/object of just a subtree (for example, just 'level1_item_c' and all it's children)?

Comments

  • edited 10:14PM
    There currently isn't. However, I could see there being an addition to the Menu class for a render_type of "array" that would generate the nested array. I've put it on the list, but it probably won't be out in the very near feature. If, however, you are able to get something working on your end, please send it over and I'll add it in.
  • edited 10:14PM
    Alright, thanks! I might write it then and in that case, I'll definitely share what I end up with.
  • edited 10:14PM
    I have a modified version of the Menu class that will output an array if you want me to email it to you so you can test it out. I plan on adding it (or something close) in the upcoming 0.9.3 release.
  • edited 10:14PM
    Yeah, I'd like to test it out! wilchow@gmail.com
  • edited 10:14PM
    was this ever created? if so, please let me know. if not, i can help put this together
  • edited 10:14PM
    You can use the render_type of "array" like so:
    echo fuel_nav(array('render_type' => 'array'));
Sign In or Register to comment.