Using Zend, I want to create a navigation like:
<ul class="navigation">
<li>
<a href="/coupon/index/all"></a>
</li>
<li>
<a href="/coupon/index/most-popuplar">Most Popular</a>
</li>
<li>
<a href="/coupon/index/most-recent">Most Recent</a>
</li>
<li>
<a href="/coupon/index/ending-soon">Ending Soon</a>
</li>
</ul>
But when I used Zend Navigation with config like below:
<?xml version="1.0" encoding="UTF-8"?>
<configdata>
<nav>
<label>All</label>
<module>coupon</module>
<controller>index</controller>
<action>all</action>
<pages>
<popuplar>
<label>Most Popular</label>
<module>coupon</module>
<controller>index</controller>
<action>most-popuplar</action>
</popuplar>
<recent>
<label>Most Recent</label>
<module>coupon</module>
<controller>index</controller>
<action>most-recent</action>
</recent>
<ending>
<label>Ending Soon</label>
<module>coupon</module>
<controller>index</controller>
<action>ending-soon</action>
</ending>
</pages>
</nav>
</configdata>
The result is always:
<ul class="navigation">
<li>
<a href="/coupon/index/all"></a>
<ul>
<li>
<a href="/coupon/index/most-popuplar">Most Popular</a>
</li>
<li>
<a href="/coupon/index/most-recent">Most Recent</a>
</li>
<li>
<a href="/coupon/index/ending-soon">Ending Soon</a>
</li>
</ul>
</li>
</ul>
So, I know that I am wrong with my config, but I don’t know how to make it becomes correct. Could you please help me. Many thanks.
I believe the only way to fix this is to move your
allActioninto the pages node. And really that’s the way it should be structured, because you’re not using anindexAction. You’ve put yourallActionwhere theindexActionshould be.If you don’t have an
indexAction, you should just ignore it in your XML navigation config, as well. That will at least get you closer to what you’re looking for.Or, if you’re looking to use this config for general purpose, you should add the
indexActionwhere you have theallActionright now, and then do something like this in your layout or other view (or wherever):Then in your css file: