How to use Navigation Menu/Pages at frontend?

edited December 2010 in Share
Hello,

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?

Comments

  • edited 5:15PM
    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 5:15PM
    To render the menu, I'd use the fuel_nav() function. The fuel_nav() function is a wrapper around the Menu class.
    http://www.getfuelcms.com/user_guide/helpers/fuel_helper
    http://www.getfuelcms.com/user_guide/libraries/menu

    We wrote a blog post last weeks about using menus that may help too:
    http://www.getfuelcms.com/blog/2010/12/12/learning-fuel-cms-part-2

    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):
    http://www.getfuelcms.com/user_guide/helpers/fuel_helper
    http://www.getfuelcms.com/user_guide/libraries/my_model
  • edited 5:15PM
    Thank you..
    This is the great help!!!! I will study all and checkout.
  • edited December 2010
    Hello,

    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 5:15PM
    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 :)

    Thanks
Sign In or Register to comment.