Need a Demonstration for the 'styles' parameter for the fuel_nav function

edited November 2012 in Modules
Hello, can someone demonstrate how to use the 'styles' parameter showcased here?
http://www.getfuelcms.com/user_guide/libraries/menu

It says "CSS class styles to apply to menu items... can be a nested array". My problem is how should this array be formatted? I have tried these two options (see below) and neither work, so I just need someone who knows how this works to give me a working example. Thanks!

<?=fuel_nav(array('group_id' => 'Secondary', 'styles' => 'margin-0')); ?>
<?=fuel_nav(array('group_id' => 'Secondary', 'styles' => array('li' => 'margin-0') )); ?>

Comments

  • edited 6:25AM
    They should actually be class names. For example, say you want to add a class to the second level of a navigation structure. You can do something like the following for fuel_nav:

    $css_classes = array(); $css_classes[0] = 'test'; // will apply class="test" to all li elements on the first level $css_classes[0] = array(1 => 'test'); // will apply class="test" to the 2nd li element on the first level $css_classes[1][1] = 'test2'; // will apply the class="test2" to the 2nd element (index 1), of the 2nd level (index 1). fuel_nav(array('styles' => $css_classes));
Sign In or Register to comment.