News:

Want to get involved in developing SMF, then why not lend a hand on our github!

Main Menu

[Tip] Drop Down Menu Tutorial (..for all themes)

Started by Hoochie Coochie Man, August 05, 2008, 05:37:39 AM

Previous topic - Next topic

Marcus Forsberg

Looks nice, I'll test it later and then tell you how it works

Marcus Forsberg

Itried, but I can't get this working for Kelo-lt theme.
Please help?

Jessikard

#62
now i have a big problem...
i tried the code for a new button like the following one

                  //the [helplist] list button
LINE 640 ->   if ($context['allow_help'])

                  echo '
                   <li class="level1 parent"><a href="', $scripturl, '?action=help" class="level1"><span><span class="title">Hilfe</span></span></a>
                   <ul class="level2">
      <li class="level2"><a href="http://www.*************.de/index.php?pid=2" target="_blank" class="level2"><span>VK-Anleitung</span></a></li>
      <li class="level2"><a href="http://www.*******.de/cgi-bin/faqserver/user/FAQ******/index.pl" target="_blank" class="level2"><span>FAQs</span></a></li>
      <li class="level2"><a href="http://www.**********.de/index.php?pid=4" target="_blank" class="level2"><span>Unser Team</span></a></li>
      <li class="level2"><a href="http://www.**********.de/forum/index.php?topic=11673.msg59886#msg59886" class="level2"><span>Hausordnung</span></a></li>
      <li class="level2"><a href="', $scripturl, '?action=blog">', ($modSettings['blogMode'] == 3) ? $txt['Blogs'] : $txt['blog'], ' class="level2"><span><span class="title">Blog-Liste</span></span></a></li>
  <li class="level2"><a href="', $scripturl, '?action=bookmarks">' , $txt['bookmarks'] , ' class="level2"><span><span class="title">Lesezeichen-Liste</span></span></a></li>
                  </ul></li>';


then i get an parse error: unexpecting error in line 640 ';' or ','

so i deleted the Line 640 but then i get an error in the line echo'

can you tell me please what´s wrong

Jessi

using smf 1.1.5 with MKPortal

Antechinus

Most likely the closing tag of your preceding button is missing the '; after it.

You probably have </li> when if it's going in front of a context statement it should be </li>';

Jessikard

so you say i have to make a '; after each row of class level2 , right?

but the error is in this line ->  if ($context['allow_help'])

Antechinus

No. What I'm saying is that (correct me if I'm wrong here) you have a home button followed by a help button. That's the usual order.

Normally the help button doesn't have a context statement in front of it.
If it doesn't then the closing tag of the home button should just be </li>

However if you want to put a context statement after that you need to use </li>';

That's the correct syntax for php.


Antechinus

#66
Oh and don't believe everything the error messages tell you. The error sometimes is not on the line it says. It can be before that. I'm just taking the next most obvious line.

What's the code for the button in front of your help button?

Sabre™

#67
What is above     //the [helplist] list button
That may be where you need to add   ';
It'd be easier if you uploaded your index.template for someone to look at, or show 5 lines above and below the error line.

Quote from: antechinus on September 11, 2008, 09:41:22 AM
Oh and don't believe everything the error messages tell you.

Edit: Sorry, I missed this
Quote from: antechinus on September 11, 2008, 09:41:22 AM
What's the code for the button in front of your help button?
Do NOT give admin and/or ftp details to just anybody, see if they are trust worthy first!!  Do your homework ;)


Jessikard

#68
now i´m totally confused

i show you the whole index.template



Marcus Forsberg

Find:
                  <li class="level1"><a href="', $scripturl, '" class="level1"><span><span class="title">' , $txt[103] , '</span></span></a></li>

And replace whit:
                  <li class="level1"><a href="', $scripturl, '" class="level1"><span><span class="title">' , $txt[103] , '</span></span></a></li>';

Jessikard

okay, i added the '; after the line and now i get now error ... great job thx

but the next problem is, that i can´t see this button in my forum

first the home-button and then the search-button but no help-button  :-[


Jessikard

#71
wow, now i fixed the problem with the help-button

so i have one more problem with the linkmenu under the buttons

i try to descibe:

if i´m on my help-button the linktree will be shown but when i try to click on one of these links the menu get back
i think this problem is in the style.css because the main-button has a background but the underlink not

wher is the point to fix it

help please


babjusi

Why don''t you package it it up as a mod this HCM? I think that a lot of people will find it very useful

Jessikard

 :D i played with my css an fixed the problem

now it works fine - thx for all the help

espressoguy

When I go to the Demo Site to try the "Live Demo" from HCM's original post, there are several serious defects with it.  Does this work properly? Is it that someone has just done something to the demo (messed it up somehos)?

Antechinus

I logged in and it seems ok. The only problem is that either the font-color is currently set the same as the drop menu background or the language strings are currently missing. Since it is a test site it's quite possible HCM has been messing around. The drops are still functioning though.

Panache Web

is there any way to mod this to 2.0 or create a mod for the menu for 2.0 instead of manually editing this?

Bugpac ™

If you dont wanna mod it' Will you mod my files for me, I am lost doing that part...

Taragon

great work but unfortunately does not work with IE6, if this could be fixed then I think it would be a brilliant piece of code.

I know, tell people to upgrade, but from a marketing perspective of making the site viewable to the majority, that is not really a solution.


Antechinus

CSS based drop menus do not work with IE6. This has been covered several times in this thread and others. If you want drop menus in IE6 you'll need to use javascript, and of course that will not work with script blockers whereas CSS menus will. Take your pick.

The percentage of people still using IE6 is dropping rapidly and they are not the majority these days. They're still a significant minority but that will change in the near future.

Advertisement: