1

is there any method to create page strucutere with Zend_Navigation (xml) like this:

- 1. Dashboard
- - 1.1 New article
- - 1.2 New user
- - 1.3 New products
- 2. Articles
- - 2.1 New article
- - 2.2 Reviews
- 3. User
- - 3.1 New user
- - 3.2 Etc Etc...
-
-

- I'am trying to do by this XML (example xml) But it works unexpectly, because on Article page are loaded pages for Dashborad and both pages (Artcile adn Dashboards) are active:

<?xml version="1.0" encoding="UTF-8"?>
<config>
    <navigation>
        <dashboard>
            <label>Dashboard</label>
            <module>admin</module>
            <controller>index</controller>
            <action>index</action>
            <pages>
                <add>
                    <label>New</label>
                    <module>admin</module>
                    <controller>recension</controller>
                    <action>add</action>
                </add>
            </page>
        </dashboard>
        <articles>
            <label>Articles</label>
             <module>admin</module>
             <controller>articles</controller>
             <action>index</action>
            <pages>
                <overview>
                    <label>Preview</label>
                    <module>admin</module>
                    <controller>articles</controller>
                    <action>index</action>
                </overview>
                <add>
                    <label>New</label>
                    <module>admin</module>
                    <controller>articles</controller>
                    <action>add</action>
                </add>
             </pages> 
        </articles>     
    </navigation>
</config>

Thanks for any suggestion.

1 Answer 1

1

It works as it should work. Zend_Navigation sets page as active because it is active. If you have same page in different places and don't want them to be active at the same it means you have bad navigation design.

There are two workarounds

  1. Define more zend navigation containers - but it's not easy to work with
  2. Add additional params to pages for example rel=dashbord to determine single active page

It would be something like

<dashboard>
    <label>Dashboard</label>
    <module>admin</module>
    <controller>index</controller>
    <action>index</action>
    <pages>
        <add>
            <label>New</label>
            <module>admin</module>
            <controller>recension</controller>
            <action>add</action>
            <params>
                <rel>dashboard</rel>
            </params>
        </add>
    </page>
</dashboard>
Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.