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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T09:03:12+00:00 2026-05-15T09:03:12+00:00

In my toplevel menu items, I would like to make a subline for each

  • 0

In my toplevel menu items, I would like to make a subline for each item. I don’t think it’s possible to do by default, byt YooTheme has done it in many of their templates.

The menu output look like this

<div class="moduletable_menu">
<ul id="mainmenu" class="menu">
    <li class="active item1" id="current">
        <a href="URL_HIDDEN">
            <span>Services</span>
        </a>
    </li>
</ul>

This basically outputs a one line menu item like so:

Services

What I would like to do is have a menu item like this:

Services
Service x, Service y, Service z

For reference, have a look at the main menu on the YooTheme demo page.

The way YooTheme does this, is using two pipes (||) as a linebreak, so in the Joomla backend you type “Services||Service x, Service y, Service z” as the menu title, and then there must be some fancy javascript that breaks this title into two spans, ready to be styled using css.

Does anyone know of an easy way to code this?

Please note that I am looking to build this feature into a custom template (ie. non-yootheme).

Also note that I am not using MooTools, but Jquery instead.

  • 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-15T09:03:13+00:00Added an answer on May 15, 2026 at 9:03 am

    I finally figured this out, and thought I’d share it, if anyone else needs this.

    First of all you need to create a template override for the mod_mainmenu.

    Next, open up the override file (default.php) and insert this peice of code after the last IF:

    // add title & sub span
    if (isset($node->_children[0]) && isset($node->_children[0]->span[0])) {
        $title = $node->_children[0]->span[0];
        $split = explode('//', $title->data(), 2);
        if (count($split) == 2) {
            $span =& $node->_children[0]->span[0]->addChild('span', array('class' => 'title'));
            $span->setData(trim($split[0]));
            $span =& $node->_children[0]->span[0]->addChild('span', array('class' => 'sub'));
            $span->setData(trim($split[1]));
        }
    }
    

    Now you can type a subline in your menuitem title field, you just need to put // as a delimiter.
    Example: Lorem Ipsum//Dolor sit amet

    The outputted html looks like this:

    <li class="parent item2">
    <a href="YOURURL">
        <span>
            <span class="title">Lorem Ipsum</span>
            <span class="sub">Dolor sit amet</span>
        </span>
    </a>
    

    This can now be styled with css.

    Happy days! 🙂

    TIP! You can choose whatever delimiter you like, just make sure to change it in the default.php.
    I went with the double slash, as it’s easy to type.

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

Sidebar

Related Questions

How can I prevent toplevel menu-items of a WordPress menu to be a link?
I am using Visual Basic 6 (please don't laugh), and I would like to
According to http://msdn.microsoft.com/en-us/library/aa984351%28VS.71%29.aspx Disabling the first or toplevel menu item in a menu (for
i'm working on styling my site's main menu and i would like to add
I have a dialog application in which I want to have clickable menu items
I want to pull out menu items from MySQL. Main menu id=1, parentid=0 -Contact
I am looking to create a report of menu items. Here's a simplified example
I need to make a control with popping out menu and button that causes
I created a new module and a new top level menu item in the
I am creating a menu that will have its menu items injected into it

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.