Author Topic: Superfish has no arrows fo submenu?  (Read 4097 times)

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Superfish has no arrows fo submenu?
« on: February 07, 2014, 11:19:49 AM »
Hello, I know this was already asked, but I couldnt find the right anwser.

Im having problems implementing the superfish menu in my template so that it would show little arrow for the submenues. The menu and submenus are working fine but there is no arrows for them.

Original html code:
Code: [Select]
<nav>
                <ul class="sf-menu">
                    <li class="current"><a href="#">about me</a></li>
                    <li class="indice"><span></span><a href="#">services</a>
                    <ul>
                            <li><a href="#">Consulting</a></li>
                            <li><a href="#">Education</a>
                            <ul>
                                <li><a href="#">auystys uase</a></li>
                                </ul>
                            </li>
                            <li><a href="#">careers</a></li>
                        </ul>
                    </li>
                    <li><a href="#">publications</a></li>
                    <li><a href="#">links</a></li>
                    <li><a href="#">contacts</a></li>
                </ul>
                <div class="clear"></div>
            </nav>


And my sf code: There is span indice class but I dont, know where to put it in my menu. Im no coder :( 

Code: [Select]
<nav>
                <ul class="sf-menu, current">
                    <?php show_menu2(
        
$aMenu          1,
        
$aStart         SM2_ROOT,
        
$aMaxLevel      SM2_ALL,
        
$aOptions       SM2_ALL|SM2_PRETTY,
        
$aItemOpen      '[li] [a][menu_title]</a>',
        
$aItemClose     '</li>',
        
$aMenuOpen      '<ul class="current">',
        
$aMenuClose     '</ul>',
        
$aTopItemOpen   false,
$aTopMenuOpen   '<ul class="sf-menu">',
$aTopMenuOpen   false,
        
$alastbutton    true
); ?>


                </ul>
                <div class="clear"></div>
            </nav>

Hope someone can help me here

thank you.

R.

Offline nibz

  • Posts: 684
  • Gender: Male
Re: Superfish has no arrows fo submenu?
« Reply #1 on: February 07, 2014, 01:53:46 PM »
I think this will work:

Code: [Select]
<nav>
<?php show_menu2(
        
        $aMenu          1,
$aStart         SM2_ROOT,
$aMaxLevel      SM2_ALL,
        
        $aOptions       SM2_ALL|SM2_PRETTY,
$aItemOpen      '<li class="[if(class==menu-current){current}] [if(class==menu-expand){indice}]">[if(class==menu-expand){<span></span>}][a][menu_title]</a>',
$aItemClose     '</li>',
$aMenuOpen      '<ul>',
$aMenuClose     '</ul>',
$aTopItemOpen   false,
$aTopMenuOpen   '<ul class="sf-menu">'
); ?>

<div class="clear"></div>
</nav>

  • added current class to work with your code (the default show_menu2 current class is menu-current).
  • added indice class when li has subitems.
  • removed the "hardcoded" ul wrapper, added this to aTopMenuOpen so it won't add this code twice.
  • removed the alastbutton because i don't know where this is needed for, as far as i know this is not a show_menu2 parameter
  • to be sure if your theme also needs the <span></span> i added them

Regards Robin
« Last Edit: February 07, 2014, 03:16:35 PM by nibz »

Offline Roych

  • Betatester
  • **
  • Posts: 573
  • Gender: Male
Re: Superfish has no arrows fo submenu?
« Reply #2 on: February 07, 2014, 03:10:45 PM »
Oh, yeees, thank you very much It's working perfect, now ;)

I have to study those menu codes somehow ... :|


You're the man ;)

R

Offline nibz

  • Posts: 684
  • Gender: Male
Re: Superfish has no arrows fo submenu?
« Reply #3 on: February 07, 2014, 03:15:52 PM »
I have to study those menu codes somehow ... :|

You're welcome.
You can study the menu codes here: Tutorial link removed 404
« Last Edit: December 31, 2017, 03:45:57 PM by Luisehahne »