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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T22:56:30+00:00 2026-06-13T22:56:30+00:00

How can I custom the output menu like stack in drupal 7. The main

  • 0

How can I custom the output menu like stack in drupal 7. The main menu link appear above and the sub-menu link appear below, or some menu styles like this.

In Bartik theme, the $main_menu variable only content primary menu information but no child. So I must custom this variable or do something else to solve my problem ? Here is what i said:

<div id="main-menu" class="navigation">
    <?php print theme('links__system_main_menu', array(
      'links' => $main_menu,
      'attributes' => array(
        'id' => 'main-menu-links',
        'class' => array('links', 'clearfix'),
      ),
      'heading' => array(
        'text' => t('Main menu'),
        'level' => 'h2',
        'class' => array('element-invisible'),
      ),
    )); ?>
  </div> <!-- /#main-menu -->
  • 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-06-13T22:56:31+00:00Added an answer on June 13, 2026 at 10:56 pm

    You can use drupal’s standard menu output with parent menu items and sub menu items, then customize the appearance to your liking using CSS and javaScript.

    You can benefit from the fact of that the sub menu items will appear ONLY for an active parent.

    Just make sure that Mark as expanded for ALL parent menu items is checked off so they don’t show by default.

    Update:

    Don’t print out the menu in the template file. Instead, create a region in the same position then install menu block module.

    This way is more flexible than yours and gives you more options to control your menu (like the depth of sub items).

    Check the module documentation for more details. Configuring menu blocks section.

    Hope this helps… Muhammad.

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

Sidebar

Related Questions

I am learning PyQt and wonder if one can create custom/owner draw control like
I have a view which lists some nodes and I want a custom output
I have a class that I need to do some custom XML output from,
I would like to output a csv file with a drupal 6 module. This
I'm trying to override a custom menu output in a block so that instead
Can a custom event be created for any object method? To do this do
In Windows I can post custom message to another process and inform it to
JPQL queries can return custom result objects with the NEW operator: SELECT NEW myPackage.MyVO(e.fieldX,
Just want to ask if i can use Custom Validator in client side without
With the [attribute] notation I can attach custom attributes to class instance methods. But

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.