Note the upgraded forum! If you are experiencing issues logging in, you may need to reset your password which should send an email. If the email doesn't arrive, be sure to check your spam folder just in case.

How to use Navigation Menu/Pages at frontend?

edited December 2010 in Share

I have created some new pages from the admin, inside "Navigation" link
Now I want to show that menu in frontend (Home page). So what is the best way to set navigation?


  • edited 2:11PM
    Same question is also for my custom modules,

    Like I have created module name as "ads"

    in that I have category,subcategory,products.
    Now I want to show that list in home page, So how can I retrieve it from my module?

    What is the best way for it?
  • edited 2:11PM
    To render the menu, I'd use the fuel_nav() function. The fuel_nav() function is a wrapper around the Menu class.

    We wrote a blog post last weeks about using menus that may help too:

    With regards to your second question, if you are wanting to get your model data into your views, you can use the fuel_model helper function or load the module in like so:
    // using the helper function fuel_model('ad_categories', array('module' => 'ads')); // using the load method $CI->load->module_model('ads', 'ad_categories_model'); $categories = $CI->ad_categories_model->find_all();

    Here are some reference links for fuel_model and MY_Model (which is a base model that your module models inherit from):
  • edited 2:11PM
    Thank you..
    This is the great help!!!! I will study all and checkout.
  • edited December 2010

    I have seen the Menu Class & fuel_nav(), it's working extremely fine..
    Just only one thing I didn't found any where.. And that is, How to set custom CSS class in [ul] tag?

    For Example, According to my custom layout, I have below type of menu code.

    [ul id="main_menu" class="main_menu"] [li]<a href="/about">About</a>[/li] [li]<a href="/feedback">Feedback</a>[/li] [/ul]

    by fuel_nav() how can I set property (id, class) of [ul] tag?
  • edited 2:11PM
    Ahhh.. I got it from Property list, it's like below..

    <?php echo fuel_nav(array('container_tag_id'=>'menu')); ?>

    Done... And now working fine :)

Sign In or Register to comment.