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 7:33AM
    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 7:33AM
    Alright, thanks! I might write it then and in that case, I'll definitely share what I end up with.
  • edited 7:33AM
    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 7:33AM
    Yeah, I'd like to test it out! wilchow@gmail.com
  • edited 7:33AM
    was this ever created? if so, please let me know. if not, i can help put this together
  • edited 7:33AM
    You can use the render_type of "array" like so:
    echo fuel_nav(array('render_type' => 'array'));
Sign In or Register to comment.