Add nav-level-$level CSS classes to navigation
This commit is contained in:
parent
dc273aa9a1
commit
4eb92438dd
|
@ -271,9 +271,11 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
|
||||||
/**
|
/**
|
||||||
* Return the opening markup for multiple navigation items
|
* Return the opening markup for multiple navigation items
|
||||||
*
|
*
|
||||||
|
* @param int $level
|
||||||
|
*
|
||||||
* @return string
|
* @return string
|
||||||
*/
|
*/
|
||||||
public function beginChildrenMarkup()
|
public function beginChildrenMarkup($level = 1)
|
||||||
{
|
{
|
||||||
$cssClass = array(static::CSS_CLASS_NAV);
|
$cssClass = array(static::CSS_CLASS_NAV);
|
||||||
if ($this->navigation->getLayout() === Navigation::LAYOUT_TABS) {
|
if ($this->navigation->getLayout() === Navigation::LAYOUT_TABS) {
|
||||||
|
@ -282,6 +284,8 @@ class NavigationRenderer implements RecursiveIterator, NavigationRendererInterfa
|
||||||
$cssClass[] = static::CSS_CLASS_NAV_DROPDOWN;
|
$cssClass[] = static::CSS_CLASS_NAV_DROPDOWN;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$cssClass[] = 'nav-level-' . $level;
|
||||||
|
|
||||||
return '<ul class="' . join(' ', $cssClass) . '">';
|
return '<ul class="' . join(' ', $cssClass) . '">';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -142,7 +142,7 @@ class RecursiveNavigationRenderer extends RecursiveIteratorIterator implements N
|
||||||
*/
|
*/
|
||||||
public function beginChildren()
|
public function beginChildren()
|
||||||
{
|
{
|
||||||
$this->content[] = $this->getInnerIterator()->beginChildrenMarkup();
|
$this->content[] = $this->getInnerIterator()->beginChildrenMarkup($this->getDepth() + 1);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
|
Loading…
Reference in New Issue