Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Zend_Navigation_Container set separator

Is there a way when using Zend_Navigation to set a separator for pages?

For example, I call $this->navigation()->menu() in my view to render a navigation menu in a form of an unordered list. I would like there to be a separator between all menu items, for example |.

So, every menu item which is not last, would end with:

</a> | </li>
like image 460
Richard Knop Avatar asked Jun 04 '26 14:06

Richard Knop


1 Answers

You can do it in CSS like this.

li:before {
    content: "|";
}

li:first-child:before {
    content: "";
}

li:first-child a {
    margin-left: 0;
}

li a {
    margin: 0 0 0 2mm;
}

The reverse logic here is for browser compatibility. IE < 9 doesn't support last-child but supports first-child.

like image 66
Richard Ayotte Avatar answered Jun 08 '26 00:06

Richard Ayotte