Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 6762255
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 26, 20262026-05-26T14:17:54+00:00 2026-05-26T14:17:54+00:00

What I am asking is similar to this issue , which is still unresolved.

  • 0

What I am asking is similar to this issue, which is still unresolved.

I’m trying to create a good submenu solution, but I can’t seem to get Zend_View_Helper_Navigation_Menu to work with me.

Here is my XML navigation config:

<configdata>
    <nav>
        <index>
            <label>Index</label>
            <uri>/</uri>
            <pages>

                <home>
                    <label>home</label>
                    <uri>/</uri>
                </home>

                <about>
                    <label>about</label>
                    <uri>/about</uri>
                </about>

                <works>
                    <label>works</label>
                    <uri>/works</uri>
                    <pages>
                        <music>
                            <label>music</label>
                            <uri>/works/music</uri>
                        </music>
                    </pages>
                </works>
                <posts>
                    <label>posts</label>
                    <uri>/posts</uri>
                </posts>                
                <admin>
                    <label>admin</label>
                    <uri>/admin</uri>
                    <pages>
                        <login>
                            <label>log in</label>
                            <uri>/admin/login</uri>
                        </login>
                        <settings>
                            <label>settings</label>
                            <uri>/admin/settings</uri>
                        </settings>
                        <register>
                            <label>register</label>
                            <uri>/admin/register</uri>
                        </register>
                        <logout>
                            <label>log out</label>
                            <uri>/admin/logout</uri>
                        </logout>
                    </pages>
                </admin>

            </pages>
        </index>
    </nav>
</configdata>

And here is the relevant code in my layout:

echo $this->navigation()->menu()->renderMenu(
    null, 
    array(
        'minDepth' => 2, 
        'maxDepth' => 2, 
        'onlyActiveBranch' => true
    )
);

When I navigate to ‘admin’, I don’t see the submenu. If I change the minDepth to 1 I can see that that menu and its children are ‘active’ in the source. Why are they not being rendered when the minDepth is set to 2?

I did a workaround for this, but I have to copy/paste it into every controller for it to work (because I need the request object in order to do it):

    $pages = $this->view->navigation()->current()->getPages();
    foreach ($pages as $page) {
        $this->_setChildrenInvisible($page);
    }

the _setChildrenInvisible() function:

private function _setChildrenInvisible(Zend_Navigation_Container $container) {
    foreach ($container as $child) {
        if ($child->hasChildren()) {
            $this->_setChildrenInvisible($child);
        }
        $child->setVisible(false);
    }
}

Im just trying to get admin‘s children to render in the submenu. Does anyone know how to fix this?

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-26T14:17:55+00:00Added an answer on May 26, 2026 at 2:17 pm

    In the layout, in the renderMenu method, the renderParents attribute should be set to false

    echo $this->navigation()->menu()->renderMenu(
        null, 
        array(
            'minDepth' => 2, 
            'maxDepth' => 2, 
            'onlyActiveBranch' => true, 
            'renderParents' => false
        )
    );
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

This question is 'similar' to this but I'm asking for alternative (if it exists).
I've been asking similar questions here today, but I'm seeing I think the issue
Similar to this question asking about relatively light-weight data entry / editor application development,
I know there are several threads asking similar questions - but I havent found
There are many similar questions, but apparently no perfect match, that's why I'm asking.
I am asking this question on SO because a similar question was asked here
I'm asking a question very similar to this one —dare I say identical? An
Sorry to be asking such similar question again, I am trying to read the
My question is similar to this one and this one , but there is
I was asking the similar question last saturday, but seems like the smart folks

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.