How to create drop down while the menu structure is in array type? I have created menus with sub-menus in the header.

It is supported by some themes .

But some themes don't support this. e.g Bartik, fontfolio etc.

I want to use the drop down as customized in the main-menu region, so as to display in these themes also.

How can I edit this in the drupal page.tpl?

As I am new to drupal, please suggest me.

E.g Dropdown not Supported in this format:

    &lt;?php print theme('links__system_main_menu', array(
      'links' =&gt; $main_menu,
      'attributes' =&gt; array(
        'id' =&gt; 'menu',
        'class' =&gt; array('links', 'inline', 'clearfix', 'menu'),
      ),
      'heading' =&gt; array(
        'text' =&gt; t('Menu'),
        'level' =&gt; 'h2',
        'class' =&gt; array('element-invisible'),
      )));
    ?&gt;
I have found some possible answers related to your solution.

SOLUTION 1:

The main menu in Bartik only displays the first level. Since it's hardcoded in page.tpl.php there's nothing you can do about it.

Here's how to get the menu to work properly:


In your theme settings (admin/appearance/settings/bartik) disable "Main menu".
Go to admin/structure/block and add the "Main Menu" block to the header region (or wherever you want it).


Alternatively, you can also check out the excellent Menu Block module, which generates extra customizable blocks (1st level, 2nd level, etc) for each menu.

SOLUTION 2:

There are some useful resources that may help you to solve your problem.


How to create a drop down menu in bartik theme
Drupal 7 + Bartik + Dropdown for Main Menu Children
Add drop down menu support to Bartik
Drupal Responsive Bartik Theme with Dropdown Menus