Andrew Plank
Andrew Plank

Reputation: 1009

Configure Zend_Navigation with two actions activating one menu item?

I'm in a situation where I have a Zend_Navigation menu defined in XML. In the menu, the design requires a single page for displaying user data. Administrators may view other users' data. Because there are subtle differences in the data displayed and view layouts, it's necessary to have two actions, one for normal users, and one for administrators.

How can I define a Zend_Navigation XML file so that two actions on the same controller both set the same page as active? Preferably using only XML. Is it even possible?

Upvotes: 0

Views: 188

Answers (1)

akond
akond

Reputation: 16035

<?xml version="1.0" encoding="UTF-8" ?>
<configdata>
  <nav>
    <home>
      <label>Home</label>
      <controller>test</controller>
      <action>menu</action>
      <module>default</module>
      <pages>
        <why>
          <label>why</label>
          <controller>test</controller>
          <action>menu</action>
          <module>default</module>
          <visible>false</visible>
        </why>
        <who>
          <label>who</label>
          <controller>test</controller>
          <action>quake</action>
          <visible>false</visible>
        </who>
      </pages>
    </home>

The idea is to make both pages invisible and both should be the children of a visible page, which will be displayed as active.

Upvotes: 2

Related Questions