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 314011
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 12, 20262026-05-12T08:09:39+00:00 2026-05-12T08:09:39+00:00

I’m using Zend_Navigation (sweet addition to the framework, btw) to build my menu, after

  • 0

I’m using Zend_Navigation (sweet addition to the framework, btw) to build my menu, after which it should be rendered in the page (self-evidently). I first set the container somewhere in the controller:

// $pages is the array containing all page information
$nav = new Zend_Navigation($pages);
$this->view->navigation($nav);

Then, in the layout, it is rendered like this:

echo $this->navigation()->menu();

which works perfectly. Now: I want the menu to be rendered a little differently. The page I’m building uses the jQuery Fisheye-plugin to build a Mac-like Dock-menu. However, this plugin needs a specific markup…

Actually, it takes a list of <a> elements containing both an <img> (for the icon) and a <span> (for the tooltip). The standard Menu view helper renders everything inside an unordered list (logically), with the 'label' parameter as the link text.

It seems that content passed to the 'label' parameter is escaped before rendering, so inserting the html there won’t do me any good. Additionally, the Fisheye usually doesn’t seem to take its items contained in a <li> tag, with the entire thing wrapped in <ul></ul>, but just a one-level list of <a> elements.

I was thinking about writing a custom view helper for the dock, which would be able to take care of inserting the <img> and the <span>, but I’m having a very hard time getting a custom view helper attached to the Navigation class. I just can’t figure out where to place it and in what way, even though all my other custom classes (models and such) are sweetly taken care of by the autoloader. Any ideas on this?

Then again, even if I can get this view helper to work, I’m still left with the HTML unordered list – I know I can lose that one too using the custom view helper, but I’ve always been a fan of containing main navigation menus inside a list, for the sake of semantics.

If anyone can help me out a little, I’d greatly appreciate it. If the Fisheye just isn’t meant to work with <ul>‘s, that’d be too bad… would there be a good reason for losing Zend_Navigation altogether in this case?

  • 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-12T08:09:40+00:00Added an answer on May 12, 2026 at 8:09 am

    I haven’t seen the way yet either in terms of making a custom renderer. Here’s what I ended up doing though:

    First, instead of rendering the default menu() call, create a partial to render into:

    // menu.phtml is partial, cms is module
    $partial = array('menu.phtml', 'cms');
    $this->navigation()->menu()->setPartial($partial);
    echo $this->navigation()->menu()->render();
    

    Then (from the docs), you can create a “custom” render like so:

    // -- inside menu.phtml
    foreach ($this->container as $page) 
    {
        // this just prints a "<a>" or "<span>" tag
        // depending on whether the page has a uri
        echo $this->menu()->htmlify($page), PHP_EOL;
    }
    

    I ended up making what I originally had (a menu with one level of submenus) with this script:

    // -- another menu.phtml
    <ul class="navigation">
    
    <?php
    
    $html = array();
    
    foreach ($this->container as $page) 
    {
        $html[] = "<li>";
        $html[] = $this->menu()->htmlify($page) . PHP_EOL;
    
        if (!empty($page->pages))
        {
            $html[] = "<ul>";
            foreach ($page->pages as $subpage) 
            {
                $html[] = "<li>";
                if ($href = $subpage->getHref()) $html[] = "<a href=\"{$href}\">";
                else $html[] = "<span>";
                $html[] = "<img src=\"/ui/cms/img/icons/edit.png\" alt=\"\"/>";
                $html[] = $subpage->getLabel();
                if ($href) $html[] = "</a>";
                else $html[] = "</span>";            
                $html[] = "</li>";
            }
            $html[] = "</ul>";
        }
    
        $html[] = "</li>";
    }
    
    echo join(PHP_EOL, $html);
    
    ?>
    </ul>
    

    You could just change the markup in the partial and add your images/icons there.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

That's pretty much it. I'm using Nokogiri to scrape a web page what has
We're building an app, our first using Rails 3, and we're having to build
I'm making a simple page using Google Maps API 3. My first. One marker
I'm new to using the Perl treebuilder module for HTML parsing and can't figure
link Im having trouble converting the html entites into html characters, (&# 8217;) i
For some reason, after submitting a string like this Jack’s Spindle from a text
I am trying to understand how to use SyndicationItem to display feed which is
I used javascript for loading a picture on my website depending on which small
I am reading a book about Javascript and jQuery and using one of the
I have a string like this: La Torre Eiffel paragonata all&#8217;Everest What PHP function

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.