I have created sub-menus in primary links but it's not showing up when I mouse over the first level menu. I have checked the Expanded check-box for parent menu but still not getting sub-menu.

Am I missing anything or this is a known issue in Twilight?

Comments

Anonymous’s picture

It happens the same to me

MBroberg’s picture

Not all themes have nested primary links. Some jsut show the top level. Suckerfish and similar type menus are programmed into some themes.
You can use Nice Menus module (drop down or flyout menus) to simulate the function, but getting it into the same place and coloration will take some work.

Anonymous’s picture

Hi MBroberg,
I don't need a drop down menu, just I'd like to have a section in Twilight theme to display sub-menus. It could be a kind of block in the left part of the theme.

MBroberg’s picture

@fairsayan
So are you looking for "secondary links" then?
Primary links would be a single row of tabs, unless you use a drop-down menu. "Expanded" means that there are sublinks under the main tabs.
Secondary Links is a completely different menu.
Nice Menus also allows you to define more than 2 menus.
If you use Nice Menus, you can enable any menu as a block and put it in any region.
If your desired region does not exist, you can edit the page.php file and the theme info file to create a region.
I learned how by studying other theme files and copying the related text.

Anonymous’s picture

Yes, I'm looking for "secondary links".

MBroberg’s picture

OK that is a different thing from the original issue which was about sublinks in the primary links.

Twilight does not have a place defined for secondary links, although they do exist as a menu, so all you have to do is find a place to put the code in the template. Otherwise you can put items into the menu, but they will not print out on the page.
I looked at other themes to find out how this works. The page.tpl.php is what you have to modify.
You will need to study the code from Twilight, and also from other themes, to understand exactly where you want the code.

Here is the code from Marinelli:

<?php if (($secondary_links)) : ?>
      <?php print '<div id="submenu">' ?>
          <?php print theme('links', $secondary_links, array('class' => 'links secondary-links')) ?>
          <?php print '</div><div class="stopfloat"></div>' ?>
        <?php endif; ?>

It basically says "if there are secondary links turned on, print a division called submenu, then print an array of the links, then print a division called stopfloat." Those divisions can be styled with css.

Here is the code from Amity Island:

 <?php if ($secondary): ?>
          <div id="secondary-links"  class="clear-block">
            <?php print $secondary ?>
	      </div>
        <?php endif; ?> 

You can see that it is a little different.
That is because this theme creates a region called "secondary" which shows up in the blocks section. You can put other things there too from the blocks admin page, whereas with the first theme it is not a block region. It just prints the secondary links.

I used the second example because I wanted a block region, and I used Nice Menus for my secondary links because I wanted drop-downs. I put the Mice Menu block into my new region. You could also use Nice Menus and put it in another region (sidebar?) without changing the page template.
If you define a new region you must declare it in the theme info file and clear your caches.

If you just want a single row of links with no dropdowns, use the first example, put it where you want it in page.tpl.php (above the header, below the primary links, below the header, etc...) and clear your cache. Links should start showing up. Style with css as desired.