1

I used the service Mobify (www.mobify.com) to create a mobile version of my site. I have done everything I wish to do, except edit my menu. I would like to remove a few items from the menu and/or add submenu items. If someone has any familiarity with Mobify I would really appreciate the help.

Edit

<nav id="x-navigation">
    <div>
        <ul>
        {! We decend into the header object, and use {.}  to iterate through each element in navigation !}  
        {#header}
            {#navigation}
                <li>{.}</li>
            {/navigation}
        {/header}
        </ul>
   </div>
</nav>
Andre Silva
  • 4,782
  • 9
  • 52
  • 65
Matt Altepeter
  • 317
  • 2
  • 5
  • 17

1 Answers1

0

When you extract your menu, I'm guessing you're doing something like this:

menu: function() {
    return $('.menu');
}

But you can actually have more advanced selectors! For example, if your menu looked like this:

<ul class="menu">
    <li class="home"><a href="/">Home</a></li>
    <li class="about"><a href="/about/">About</a></li>
    <li class="contact"><a href="/contact/">Contact</a></li>
</ul>

And if you only wanted the first two anchors, you could do something like this:

menu: function() {
    return $('.menu a').splice(0,2);   
}

Or if you only wanted "Home" and "Contact" anchors:

menu: function() {
    var $menu = $('.menu');
    $menu.find(".about").remove();
    return $menu.find('a')
}

Those are just a couple of examples of what you can do. In reality you can do anything that Javascript and Zepto allow!

shawnjan
  • 959
  • 7
  • 16
  • Thanks for your response. See my edit above. I am not familiar with Zepto at all, besides creating my template pages. The edit above contains code for the navigation generated by Mobify. And if you would like to see the site visit [http://nexgensci.com](http://nexgensci.com) on a mobile device. – Matt Altepeter Sep 18 '12 at 01:45
  • Great job on the site Matt! I went to the site and noticed that you don't have the cart functionality. Feel free to ask more questions if you want to get that working! – shawnjan Sep 26 '12 at 19:56
  • My employer did not want the cart functionality to be present. and could you try to explain in a little more detail, more precise to the edit I posted above, how to remove menu items. – Matt Altepeter Oct 08 '12 at 23:41