Modify bootstrap dropdown menu so child items appear as list page

2 posts by 2 authors in: Forums > CMS Builder
Last Post: January 12, 2016   (RSS)

By Toledoh - January 12, 2016

You need to remove the "if child"

<ul class="nav navbar-nav">

<?php if (!$categoryRecord['hide_from_navigation']): ?>
<?php echo $categoryRecord['_listItemStart'] ?>

<a href="
<?php if ($categoryRecord['redirect']): ?><?php echo PREFIX_URL ?><?php echo $categoryRecord['redirect'] ?>
<?php else: ?><?php echo $categoryRecord['_link'] ?>
<?php endif ?>
"
><?php echo $categoryRecord['name'] ?>
</a>

<?php echo $categoryRecord['_listItemEnd'] ?>

<?php endforeach; ?>
</ul>

and in the viewer code, need to add the 'onelevel'

// load pages
list($categories, $selectedCategory) = getCategories(array(
'tableName' => 'pages',
'categoryFormat' => 'onelevel', //TO REMOVE DROP DOWN NAVIGATION
'ulAttributesCallback' => 'customMenuUlAttr', // ADVANCED: custom function to return ul attributes, eg: myUlAttr($category);
'liAttributesCallback' => 'customMenuLiAttr', // ADVANCED: custom function to return li attributes, eg: myLiAttr($category);
));

Hope that helps

Cheers,

Tim (toledoh.com.au)