Simple Machines Community Forum

Customizing SMF => Tips and Tricks => Thema gestartet von: ScopeXL in Januar 15, 2010, 02:12:21 VORMITTAG

Titel: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in Januar 15, 2010, 02:12:21 VORMITTAG
Possible Tip for Tips/Tricks board?

Ok, so I noticed how SMF has 2 dropdown menus (one for the community forum which is in Curve already, and one in the header Home, Community, Download, Customize, etc... which is not included in Curve). So I modified it to add another menu to the header much like SMF does there menu.

Demo (http://www.bnetweb.org/dev/index.php)

This Tip is moderate/advanced to accomplish entirely. Follow the steps and you should be able to figure out the rest.

Thanks to ElectricSquid (http://www.simplemachines.org/community/index.php?action=profile;u=130276) for finding the location of the dropdown in Subs.php

Step 1:
In /Themes/default/index.template.php

Find:

function template_menu()


Add Before:

// Show the menu up top. The header navigation
function template_menu_top()
{
global $context, $settings, $options, $scripturl, $txt;

echo '
<div id="site_menu" class="align_right">
<ul class="dropmenu" id="site_nav">';

foreach ($context['custom_menu_buttons'] as $act => $button)
{
echo '
<li id="button_', $act, '">
<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>
</a>';
if (!empty($button['sub_buttons']))
{
echo '
<ul>';

foreach ($button['sub_buttons'] as $childbutton)
{
echo '
<li>
<a href="', $childbutton['href'], '"', isset($childbutton['target']) ? ' target="' . $childbutton['target'] . '"' : '', '>
<span', isset($childbutton['is_last']) ? ' class="last"' : '', '>', $childbutton['title'], !empty($childbutton['sub_buttons']) ? '...' : '', '</span>
</a>';
// 3rd level menus :)
if (!empty($childbutton['sub_buttons']))
{
echo '
<ul>';

foreach ($childbutton['sub_buttons'] as $grandchildbutton)
echo '
<li>
<a', $grandchildbutton['active_button'] ? ' class="active"' : '', ' href="', $grandchildbutton['href'], '"', isset($grandchildbutton['target']) ? ' target="' . $grandchildbutton['target'] . '"' : '', '>
<span', isset($grandchildbutton['is_last']) ? ' class="last"' : '', '>', $grandchildbutton['title'], '</span>
</a>
</li>';

echo '
</ul>';
}

echo '
</li>';
}
echo '
</ul>';
}
echo '
</li>';
}

echo '
</ul>
</div>';
}


Find:

', empty($settings['site_slogan']) ? '<img id="smflogo" src="' . $settings['images_url'] . '/smflogo.png" alt="Simple Machines Forum" title="Simple Machines Forum" />' : '<div id="siteslogan" class="align_right">' . $settings['site_slogan'] . '</div>', '


Replace With:

', template_menu_top(), '


Step 2:
In /Sources/Subs.php

Find:

$context['menu_buttons']['pm']['title'] .= ' [<strong>' . $context['user']['unread_messages'] . '</strong>]';
}


Add After:

// Header Menu Dropdown Begin.
   if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
   {
      $buttonsTop = array(
         'menu1' => array(
            'title' => 'Menu 1',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
               'sub_menu1' => array(
                  'title' => 'Sub Menu 1',
                  'href' => $scripturl,
                  'show' => true,
               ),
               'sub_menu2' => array(
                  'title' => 'Sub Menu 2',
                  'href' => $scripturl,
                  'show' => true,
               ),
               'sub_menu3' => array(
                  'title' => 'Sub Menu 3',
                  'href' => $scripturl,
                  'show' => true,
               ),
            ),
         ),
         'menu2' => array(
            'title' => 'Menu 2',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
               'sub_menu4' => array(
                  'title' => 'Sub Menu 4',
                  'href' => $scripturl,
                  'show' => true,
               ),
               'sub_menu5' => array(
                  'title' => 'Sub Menu 5',
                  'href' => $scripturl,
                  'show' => true,
               ),
            ),
         ),
         'menu3' => array(
            'title' => 'Menu 3',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
      );

      // Now we put the buttons in the context so the theme can use them.
      $menu_buttonsTop = array();
      foreach ($buttonsTop as $act => $button)
         if (!empty($button['show']))
         {
            $button['active_button'] = false;

            // Make sure the last button truely is the last button.
            if (!empty($button['is_last']))
            {
               if (isset($last_button))
                  unset($menu_buttonstop[$last_button]['is_last']);
               $last_button = $act;
            }

            // Go through the sub buttons if there are any.
            if (!empty($button['sub_buttons']))
               foreach ($button['sub_buttons'] as $key => $subbutton)
               {
                  if (empty($subbutton['show']))
                     unset($button['sub_buttons'][$key]);
               }

            $menu_buttonsTop[$act] = $button;
         }

      if (!empty($modSettings['cache_enable']) && $modSettings['cache_enable'] >= 2)
         cache_put_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $menu_buttonstop, $cacheTime);
   }

   $context['custom_menu_buttons'] = $menu_buttonsTop;
// Header Menu Dropdown End.


Step 3:
In /Themes/default/css/index.css

Find:

#top_section
{
min-height: 65px;
overflow: hidden;
margin-bottom: 3px;
}


Replace With:

#top_section
{
min-height: 65px;
/*overflow: hidden;*/
margin-bottom: 3px;
}
#site_menu
{
padding: 12px 0 4px 1em;
margin: 0;
/*overflow: hidden;*/
font-size: 1.1em;
font-family: tahoma, sans-serif;
}
h1.forumtitle
{
font-family: "Century Gothic", tahoma, sans-serif;
position: absolute;
}
#main_menu
{
margin-top: 1em;
}
#site_nav li a.active
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% -31px;
}
#site_nav li a.active span.firstlevel
{
background: url(../images/theme/menu_gfx.png) no-repeat 0 -31px;
}


Step 4:
Go back into /Sources/Subs.php and edit the menu items you added from this tutorial. For example to change 'Menu 1' to 'About Us' with some links

Find:

'menu1' => array(
'title' => 'Menu 1',
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
'sub_menu1' => array(
'title' => 'Sub Menu 1',
'href' => $scripturl,
'show' => true,
),
'sub_menu2' => array(
'title' => 'Sub Menu 2',
'href' => $scripturl,
'show' => true,
),
'sub_menu3' => array(
'title' => 'Sub Menu 3',
'href' => $scripturl,
'show' => true,
),
),
),


Replace With:

'about_us' => array(
'title' => 'About Us',
'href' => $scripturl,
'show' => true,
'sub_buttons' => array(
'member_list' => array(
'title' => 'Member List',
'href' => $scripturl . '?action=mlist',
'show' => true,
),
'search_site' => array(
'title' => 'Search',
'href' => $scripturl . '?action=search',
'show' => true,
),
'help_us' => array(
'title' => 'Help',
'href' => $scripturl . '?action=help',
'show' => true,
),
),
),


Step 5:
Done!

You can add as many menu items and sub items as you want, just be sure to edit Subs.php accordingly.

Attached is a screenshot of the customization when its complete. If you have any questions regarding this tip, please respond to this topic, no pm support.

I have only tested this on the default Curve theme, if you use a custom theme your results might vary.

Updated 2/25/2010: Fixed the issue with only being able to have 4 or so menu items. Should be able to use as many as you like.
Updated 3/9/2010: Updated to work with 2.0RC3 and also fixed issue of word wrapping to a new line. Should be fully functional now

Enjoy!
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Januar 15, 2010, 02:20:27 VORMITTAG
Thank for this tutorial and I will be working on this one.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Januar 15, 2010, 02:24:46 VORMITTAG
Zitat von: Dismal Shadow in Januar 15, 2010, 02:20:27 VORMITTAG
Thank for this tutorial and I will be working on this one.

no problem, let me know how it goes :)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: p1tereq in Januar 28, 2010, 10:00:52 VORMITTAG
Well, works perfectly on every SMF 2.x engine, good work. You're a star.

Thanks a million!
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: sAce in Januar 28, 2010, 11:00:13 VORMITTAG
indeed, very good tip, thanks a lot buddy
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: Sabre™ in Januar 28, 2010, 01:37:20 NACHMITTAGS
Cheers mate, I'll be using this for sure! :)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 07, 2010, 03:40:18 NACHMITTAGS
It works, but I can't add more than 4 tabs or else it will look like this:
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: steve51184 in Februar 07, 2010, 03:58:02 NACHMITTAGS
Zitat von: Dismal Shadow in Februar 07, 2010, 03:40:18 NACHMITTAGS
It works, but I can't add more than 4 tabs or else it will look like this:

yeah i had that same problem :(
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 07, 2010, 04:00:01 NACHMITTAGS
I wonder how SMF did with 9 tabs  :o
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: tfs in Februar 07, 2010, 04:32:10 NACHMITTAGS
Nice tip!  Ping for later reading...
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 07, 2010, 08:48:04 NACHMITTAGS
BTW...I believed the editing in index.css isn't needed since it works fine without it and also mess up the header related here:

http://www.simplemachines.org/community/index.php?topic=364715.msg2492256#msg2492256

Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 07, 2010, 11:48:17 NACHMITTAGS
@Dismal Shadow: I am working on a fix to be able to add more tabs to the header. Also, the edit in index.css is needed as it will just align on the top if not used, you have to tweak to your settings when using a logo that doesn't match SMF2.0 default theme.

I am no CSS wizard, and that's the only problem causing the multiple tab issues, so hopefully I'll find the underlying cause because it is "Supposed" to align on the right but when I tweak it it goes to the left. If anyone would like to take a stab at it be my guest and I'll update the existing code. I'm still fiddling with it.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 08, 2010, 12:02:13 VORMITTAG
Zitat von: ScopeXL in Februar 07, 2010, 11:48:17 NACHMITTAGS
@Dismal Shadow: I am working on a fix to be able to add more tabs to the header. Also, the edit in index.css is needed as it will just align on the top if not used, you have to tweak to your settings when using a logo that doesn't match SMF2.0 default theme.
That's what I did...
#top_section
{
min-height: 65px;
/*overflow: hidden;*/
margin-bottom: 3px;
}


I changed 65px to 120px and it works beautiful.
I was hoping someone would make it into a mod, but I guess it's not worth it since this tip is not so hard.
http://www.simplemachines.org/community/index.php?topic=362589.0
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 08, 2010, 12:04:58 VORMITTAG
I was asked if someone could turn this into a mod, I agreed. I have yet to hear from that person on progress of it. Hopefully I can fix the width of the tab bar to stretch across the entire header, which is easy, but for some reason it won't align on the right. So its being a pain.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: steve51184 in Februar 08, 2010, 12:05:49 VORMITTAG
Zitat von: Dismal Shadow in Februar 08, 2010, 12:02:13 VORMITTAG
Zitat von: ScopeXL in Februar 07, 2010, 11:48:17 NACHMITTAGS
@Dismal Shadow: I am working on a fix to be able to add more tabs to the header. Also, the edit in index.css is needed as it will just align on the top if not used, you have to tweak to your settings when using a logo that doesn't match SMF2.0 default theme.
That's what I did...
#top_section
{
min-height: 65px;
/*overflow: hidden;*/
margin-bottom: 3px;
}


I changed 65px to 120px and it works beautiful.
I was hoping someone would make it into a mod, but I guess it's not worth it since this tip is not so hard.
http://www.simplemachines.org/community/index.php?topic=362589.0

nice tip ty
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: steve51184 in Februar 08, 2010, 12:16:36 VORMITTAG
wait no that changes the wrong bit lol how do we get more on one line?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 08, 2010, 12:18:42 VORMITTAG
@ppbz: That hasn't been fixed yet.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: steve51184 in Februar 08, 2010, 12:20:40 VORMITTAG
ok but isn't it just a matter of making that space at the top right a little bigger?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 08, 2010, 12:23:41 VORMITTAG
You would think so, but no. Making it a little bigger won't fix everyone's problem. So I'm attempting to make it 100% wide and align it on the right by default, which isn't going so well. A quick fix would be to add width: XXXpx; to the #siteslogan CSS and edit the width to whatever size you need, but you'll need to change it with every tab you decide to add.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: steve51184 in Februar 08, 2010, 12:30:07 VORMITTAG
Zitat von: ScopeXL in Februar 08, 2010, 12:23:41 VORMITTAG
You would think so, but no. Making it a little bigger won't fix everyone's problem. So I'm attempting to make it 100% wide and align it on the right by default, which isn't going so well. A quick fix would be to add width: XXXpx; to the #siteslogan CSS and edit the width to whatever size you need, but you'll need to change it with every tab you decide to add.

yeah i did change it to 27px and it looks good for me but for people with different screen sizes it still drops it onto a new line

wait nm that was 27% i think i use but px works fine thank you :)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 08, 2010, 12:35:52 VORMITTAG
The reason I make it bigger because of my logo which is why it messed up with the header as shown in the image so I change it to 120. It depend how big logo you have.  ;)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: navjotjsingh in Februar 14, 2010, 06:26:40 VORMITTAG
Excellent Tutorial. Thanks a ton. :)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: diamondred123 in Februar 21, 2010, 09:32:27 VORMITTAG
can i be honest and say im not to good with the code and i always mess it up, is there not a package?

also can i make a forum or a section look work like this:
http://gta-worldmods.t-n-network.de/phpkit/start/include.php?path=content/overview.php&catid=50&type=4
because i want it to show the main images and a short description
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 25, 2010, 06:43:36 NACHMITTAGS
ScopeXL, is there any way to hide lines from guests?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 25, 2010, 07:18:17 NACHMITTAGS
Zitat von: Dismal Shadow in Februar 25, 2010, 06:43:36 NACHMITTAGS
ScopeXL, is there any way to hide lines from guests?
I assume you mean hide a link from a guest? If so then yes. Simply change the array in Subs.php for the link you want hidden

'sub_menu2' => array(
                  'title' => 'Sub Menu 2',
                  'href' => $scripturl,
                  'show' => true,
               ),


Should look like

'sub_menu2' => array(
                  'title' => 'Sub Menu 2',
                  'href' => $scripturl,
                  'show' => !$user_info['is_guest'],
               ),


All that really changes is the 'show'. make it !$user_info['is_guest'] for members eyes only, and $user_info['is_guest'] for guests eyes only.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 25, 2010, 07:21:23 NACHMITTAGS
@diamondred123: I am not sure what you are asking. I don't see any resemblance to my navigation trick on that URL. If you need help adding the navigation, PM me and I can assist you. But as for a package there is not one. Labradoodle-360 asked to make it a package, but as of now I have not heard much about it.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 25, 2010, 08:40:05 NACHMITTAGS
Zitat von: ScopeXL in Februar 25, 2010, 07:18:17 NACHMITTAGS
Zitat von: Dismal Shadow in Februar 25, 2010, 06:43:36 NACHMITTAGS
ScopeXL, is there any way to hide lines from guests?
I assume you mean hide a link from a guest? If so then yes. Simply change the array in Subs.php for the link you want hidden

'sub_menu2' => array(
                  'title' => 'Sub Menu 2',
                  'href' => $scripturl,
                  'show' => true,
               ),


Should look like

'sub_menu2' => array(
                  'title' => 'Sub Menu 2',
                  'href' => $scripturl,
                  'show' => !$user_info['is_guest'],
               ),


All that really changes is the 'show'. make it !$user_info['is_guest'] for members eyes only, and $user_info['is_guest'] for guests eyes only.
Thank you, you are a genius.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 25, 2010, 09:07:54 NACHMITTAGS
I have fixed the issue with only being able to show 4 or show menu items. Use this fix ONLY if you have made the first edits prior to this fix. I have updated my original post with the new code. Heres the fix for those of you who are already using my trick.

In /Themes/default/index.template.php

Find:

function template_menu_top()
{
   global $context, $settings, $options, $scripturl, $txt;

   echo '
      <div id="main_menu">
         <ul class="dropmenu" id="main_nav">


Replace with:

function template_menu_top()
{
   global $context, $settings, $options, $scripturl, $txt;

   echo '
      <div id="main_menu">
         <ul class="dropmenu" id="main_nav" style="float:right;">


In /Themes/default/css/index.css

Find:

#siteslogan, img#smflogo
{
margin-top: 15px;
padding: 0;
float: right;
line-height: 3em;
}


Replace with:

#siteslogan, img#smflogo
{
margin-top: 15px;
padding: 0;
float: right;
line-height: 3em;
width: 75%;
}


You should be able to add as many links as you want now. Keep in mind that users with smaller resolutions may see overflow, so don't add a ton of them. 8 or 9 should be fine considering most computers now have larger resolutions.

If for some reason your site doesn't properly display the menu, (i.e. the menu wraps down a line) then change the width of #siteslogan in index.css to a percent or pixel that fits your needs.

Any other bugs or requests let me know.

I welcome any coders to make this into a modification, just let me know.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 25, 2010, 09:10:11 NACHMITTAGS
What about the tabs? Are you saying this code now has the ability to have more than 4 tabs?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 25, 2010, 09:12:33 NACHMITTAGS
Zitat von: Dismal Shadow in Februar 25, 2010, 09:10:11 NACHMITTAGS
What about the tabs? Are you saying this code now has the ability to have more than 4 tabs?

Yes, Click here for the demo with more than 4 tabs. (http://www.bnetweb.org/dev/index.php)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: steve51184 in Februar 25, 2010, 09:15:33 NACHMITTAGS
will this ever get changed into a mod?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in Februar 25, 2010, 09:19:48 NACHMITTAGS
Zitat von: zx71 in Februar 25, 2010, 09:15:33 NACHMITTAGS
will this ever get changed into a mod?

I don't have the time at the moment to create the admin options to create, delete, or modify navigation items, if someone would like to partner with me I can certainly help with the mod creation, but I am not familiar enough with SMF mod coding to package it and do everything myself. If I had time to read up on it maybe, but as of right now I cannot.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in Februar 25, 2010, 09:20:25 NACHMITTAGS
Zitat von: ScopeXL in Februar 25, 2010, 09:12:33 NACHMITTAGS
Zitat von: Dismal Shadow in Februar 25, 2010, 09:10:11 NACHMITTAGS
What about the tabs? Are you saying this code now has the ability to have more than 4 tabs?

Yes, Click here for the demo with more than 4 tabs. (http://www.bnetweb.org/dev/index.php)
Jesus Christ...awesome.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: diamondred123 in März 02, 2010, 04:26:05 NACHMITTAGS
my one said to me:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in C:\Inetpub\webroot\version2test\Sources\Subs.php  on line 4066


and yes it is hosted off a pc, and what can i do to fix this? thanks
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in März 02, 2010, 04:31:18 NACHMITTAGS
Zitat von: diamondred123 in März 02, 2010, 04:26:05 NACHMITTAGS
my one said to me:
Parse error: syntax error, unexpected T_CONSTANT_ENCAPSED_STRING, expecting ')' in C:\Inetpub\webroot\version2test\Sources\Subs.php  on line 4066

you missed a ')' when editting the Subs.php file, look over that tab, make sure each array you open is closed. Attach your Subs.php file and I can fix it for you if you cannot find it.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: diamondred123 in März 02, 2010, 04:33:26 NACHMITTAGS
ok man i did that file again and said:
Parse error: syntax error, unexpected $end in C:\Inetpub\webroot\version2test\Sources\Subs.php  on line 3657
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in März 05, 2010, 05:37:03 VORMITTAG
This had a big impact on netbook because of its resolution.
I tried to change CSS;
the #top_section's min-height and #siteslogan, img#smflogo's width.
but it doesn't really do good. My logo is also big. I hope there's a fix for it.
The site is http://thetwoworldsforum.com
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in März 05, 2010, 05:43:50 VORMITTAG
Zitat von: Dismal Shadow in März 05, 2010, 05:37:03 VORMITTAG
This had a big impact on netbook because of its resolution.
I tried to change CSS;
the #top_section's min-height and #siteslogan, img#smflogo's width.
but it doesn't really do good. My logo is also big. I hope there's a fix for it.
The site is http://thetwoworldsforum.com

Please let me know the resolution you are experiencing problems with so I can debug on my end.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in März 05, 2010, 06:31:29 VORMITTAG
Zitat von: ScopeXL in März 05, 2010, 05:43:50 VORMITTAG
Zitat von: Dismal Shadow in März 05, 2010, 05:37:03 VORMITTAG
This had a big impact on netbook because of its resolution.
I tried to change CSS;
the #top_section's min-height and #siteslogan, img#smflogo's width.
but it doesn't really do good. My logo is also big. I hope there's a fix for it.
The site is http://thetwoworldsforum.com

Please let me know the resolution you are experiencing problems with so I can debug on my end.
Simple, Netbooks. They are mostly small.
Look at SM.org here and Dream Portal's dropdown which had no affect because they use a different code somehow.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in März 05, 2010, 12:35:54 NACHMITTAGS
In index.css, under #siteslogan, img#smflogo, change width: 75%; to width: 60%; That should fix all resolution problems. If you are still having problems try width: 50%; and lower and lower until it works with your logo.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in März 06, 2010, 02:27:09 NACHMITTAGS
Zitat von: ScopeXL in März 05, 2010, 12:35:54 NACHMITTAGS
In index.css, under #siteslogan, img#smflogo, change width: 75%; to width: 60%; That should fix all resolution problems. If you are still having problems try width: 50%; and lower and lower until it works with your logo.
50% works for me but unless they have smaller resolution it will look like this. Your demo site shows the same.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in März 06, 2010, 07:17:31 NACHMITTAGS
It all is relevant to how many tabs you use, as well as the width of the #siteslogan in the index.css, if you make the width: attribute to a fixed pixel or percentage (low enough) for users with smaller resolutions shouldn't have a problem. However I have not been able to recreate the way SMF does it yet that disables wordwrap so the navigation doesn't scroll to the next line if the resolution is small. Once I see how the CSS is parsed to not allow word wrap I will rewrite my demo and make necessary changes. For now though, a quick fix is reduce your width: attribute of #siteslogan in index.css
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in März 08, 2010, 02:56:58 VORMITTAG
Ok i have disabled this and put in default until there's a fix for this and I also believed it's my logo. Is there any way to put the logo other than "Logo image URL:" in the theme setting. Or does that affect either way no matter where I put the logo?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in März 08, 2010, 08:22:02 VORMITTAG
Zitat von: Dismal Shadow in März 08, 2010, 02:56:58 VORMITTAG
Ok i have disabled this and put in default until there's a fix for this and I also believed it's my logo. Is there any way to put the logo other than "Logo image URL:" in the theme setting. Or does that affect either way no matter where I put the logo?
It could be your logo, if you would allow me I can better debug this if I had your theme files. Simply zip your theme directory and send to me and I can fiddle with it until it seems to be working on all resolutions.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in März 08, 2010, 08:28:24 VORMITTAG
Zitat von: ScopeXL in März 08, 2010, 08:22:02 VORMITTAG
Zitat von: Dismal Shadow in März 08, 2010, 02:56:58 VORMITTAG
Ok i have disabled this and put in default until there's a fix for this and I also believed it's my logo. Is there any way to put the logo other than "Logo image URL:" in the theme setting. Or does that affect either way no matter where I put the logo?
It could be your logo, if you would allow me I can better debug this if I had your theme files. Simply zip your theme directory and send to me and I can fiddle with it until it seems to be working on all resolutions.
Cool, where do you want it attached or upload to? 
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in März 08, 2010, 08:34:22 VORMITTAG
Attach it in a reply to this, I'll reattach when I can see whats up with it.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ~DS~ in März 08, 2010, 08:37:09 VORMITTAG
Ummm...I don't think we can attach here...it's not in the additional options... :-\
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme
Beitrag von: ScopeXL in März 08, 2010, 08:39:09 VORMITTAG
Zitat von: Dismal Shadow in März 08, 2010, 08:37:09 VORMITTAG
Ummm...I don't think we can attach here...it's not in the additional options... :-\

My bad, either provide a zip from your web server or use Megaupload.com
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in März 09, 2010, 07:43:52 NACHMITTAGS
Updated for 2.0 RC3

Also fixed the problem users were having with menu items word wrapping to next line if screen resolutions were too small.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ~DS~ in März 09, 2010, 08:15:55 NACHMITTAGS
Zitat von: ScopeXL in März 09, 2010, 07:43:52 NACHMITTAGS
Updated for 2.0 RC3

Also fixed the problem users were having with menu items word wrapping to next line if screen resolutions were too small.
By looking at your demo it seem to have fixed indeed. Now I wonder how the logo would fare in this. Will test it later.


Update: Whatdidya know? It works.  :)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: MarcusJ in März 15, 2010, 12:04:09 VORMITTAG
Thank you for this guide.  Really THANK YOU!
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: MarcusJ in März 15, 2010, 11:27:36 VORMITTAG
I have a design questions pertaining to this awesome tip.

I'm using all external links.  So there wont be an active tab.  Is there a way to make them all show the active tab behind the text?  If that isn't possible is there a css edit I can make so that just the top menu is in slightly larger white text, and possibly bold?

Thanks for any help you can provide.

Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ~DS~ in März 15, 2010, 11:30:06 VORMITTAG
Zitat von: MarcusJ in März 15, 2010, 11:27:36 VORMITTAG
I have a design questions pertaining to this awesome tip.

I'm using all external links.  So there wont be an active tab.  Is there a way to make them all show the active tab behind the text?  If that isn't possible is there a css edit I can make so that just the top menu is in slightly larger white text, and possibly bold?

Thanks for any help you can provide.


You mean this?

I too would like to see this as well.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: MarcusJ in März 15, 2010, 11:37:40 VORMITTAG
Yes that.  :D  Or the css edit to make the text lighter and larger.  I'm easy.  I just wish I had the knowledge to do it on my own.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in März 15, 2010, 02:14:37 NACHMITTAGS
The CSS for it is in index.css and I'm not sure in particular but I believe its .dropmenu (or one of .dropmenu's subitems). For this tutorial I left out active tab to keep it simple for others using it as you would have to specify each action to get active tabs correctly working. If your using external links then look for

Find:

.dropmenu li a.active


And that should be the CSS for the active tab for whatever theme your using. Then change

Find:

.dropmenu li


in the CSS and replace the active tab CSS with the standard CSS which *should* make your tabs default to looking like active tabs. I don't have time right now to test this, make sure to save an original index.css backup if things go really, really wrong. Let me know how it works out and I might have time later to test this and help you out if my theory doesn't work.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: MarcusJ in März 15, 2010, 03:06:13 NACHMITTAGS
I tried it.   But it didn't work out so well.   :o



lol

Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ~DS~ in März 15, 2010, 03:10:43 NACHMITTAGS
Holy cow.  :o
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: MarcusJ in März 15, 2010, 07:37:34 NACHMITTAGS
You know I'd be really happy just being able to change the color of those links.  Seeing as active tabs wont work for external links anyway. 

I've spent about an hour trying to sort it, but I'm defeated.  It is beyond my meager understanding.    :o
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: steve51184 in März 24, 2010, 10:43:49 NACHMITTAGS
i've got this error in my error log MANY times...

ZitatApply Filter: Only show the error messages of this member  [removed]
Apply Filter: Only show the error messages of this IP address [removed]
     Reverse chronological order of list Today at 11:50:21 pm
Apply Filter: Only show the error messages of this session [removed]
Apply Filter: Only show the errors of this type Type of error: Undefined
Apply Filter: Only show the error messages of this URL
http://[removed].com/index.php?action=login2
Apply Filter: Only show the errors with the same message
8: Undefined index: href
Apply Filter: Only show the errors from this file
File: /var/www/web8/web/Themes/default/index.template.php
Line: 541

this is line 541 of index.template.php

               <a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in März 24, 2010, 10:54:17 NACHMITTAGS
Did you by any chance put a link in your top navigation drop down that doesn't link to anything? Look through your Subs.php where you put in the links yourselfs. Compare with this one link make sure they all have each item.


'link_idr' => array(
'title' => 'Link 1',
'href' => $scripturl . '?action=link',
'show' => true,
'sub_buttons' => array(
),
),
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: steve51184 in März 24, 2010, 11:00:58 NACHMITTAGS
Zitat von: ScopeXL in März 24, 2010, 10:54:17 NACHMITTAGS
Did you by any chance put a link in your top navigation drop down that doesn't link to anything? Look through your Subs.php where you put in the links yourselfs. Compare with this one link make sure they all have each item.


'link_idr' => array(
'title' => 'Link 1',
'href' => $scripturl . '?action=link',
'show' => true,
'sub_buttons' => array(
),
),


they all look like that... can i pm you what i have so you can check it?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in März 24, 2010, 11:02:09 NACHMITTAGS
sure.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: steve51184 in März 24, 2010, 11:06:40 NACHMITTAGS
Zitat von: ScopeXL in März 24, 2010, 11:02:09 NACHMITTAGS
sure.

ty pm sent
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in März 25, 2010, 12:17:39 VORMITTAG
Fixed. Check PM for solution.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: crewchiefinlife in März 30, 2010, 03:10:09 VORMITTAG
I believe I'll try this tmr.

Thanx for the tutorial.  :)

April

Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: sontar in April 01, 2010, 10:37:15 VORMITTAG
Sorry, I don't want to hijack this thread. Is there a mod for adding the top menu without the drop downs?

I just need 4 simple external links added like there is at the top of this forum. I have spent 3 hrs looking.

Thanks for your help.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in April 01, 2010, 12:16:30 NACHMITTAGS
Zitat von: sontar in April 01, 2010, 10:37:15 VORMITTAG
Sorry, I don't want to hijack this thread. Is there a mod for adding the top menu without the drop downs?

I just need 4 simple external links added like there is at the top of this forum. I have spent 3 hrs looking.

Thanks for your help.

This tip you can achieve that. Here is a sample for the Subs.php $buttonsTop array for 4 links with no dropdowns.


'menu1' => array(
            'title' => 'Menu 1',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
'menu2' => array(
            'title' => 'Menu 2',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
'menu3' => array(
            'title' => 'Menu 3',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
'menu4' => array(
            'title' => 'Menu 4',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: sontar in April 01, 2010, 01:16:24 NACHMITTAGS
Thank you very much!
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: andrew84uk in April 08, 2010, 06:30:26 NACHMITTAGS
Zitat von: Scope XL in April 01, 2010, 12:16:30 NACHMITTAGS
Zitat von: sontar in April 01, 2010, 10:37:15 VORMITTAG
Sorry, I don't want to hijack this thread. Is there a mod for adding the top menu without the drop downs?

I just need 4 simple external links added like there is at the top of this forum. I have spent 3 hrs looking.

Thanks for your help.

This tip you can achieve that. Here is a sample for the Subs.php $buttonsTop array for 4 links with no dropdowns.


'menu1' => array(
            'title' => 'Menu 1',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
'menu2' => array(
            'title' => 'Menu 2',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
'menu3' => array(
            'title' => 'Menu 3',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),
'menu4' => array(
            'title' => 'Menu 4',
            'href' => $scripturl,
            'show' => true,
            'sub_buttons' => array(
            ),
         ),


care to explain alittle?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ~DS~ in April 08, 2010, 06:57:09 NACHMITTAGS
Do all the edits from the first post expect for subs.php if you don't want dropdown then use the codes above me in the subs.php instead of the subs.php codes in the first post.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: tfs in April 08, 2010, 11:24:56 NACHMITTAGS
I'm amazed that nobody has turned this gem into a mod yet!
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Liam. in April 10, 2010, 04:28:29 NACHMITTAGS
Probably because they don't want to do with all of the support comments for non-curve themes, that may be why no-ones modified it ^_^

I love this trick and am using it on all of my sites to link to one-another (kind of like affiliating), this is in the perfect place to do it ;)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Arantor in April 10, 2010, 04:48:44 NACHMITTAGS
iKorp has it exactly right. The number of non Curve themes this would have to be applied to manually (even considering 2.0's better support for doing it) is beyond irritating.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Liam. in April 10, 2010, 07:16:07 NACHMITTAGS
Yeah, just like Ultimate Portal (http://ultimate-portal.net/) (which is going along great) is doing, including the top menu as a module, we're going to get ALOT of complaints about that from non-curve users so we're finding a way to define Curve themes to see if we can find a default way around it (maybe just static links just below <body>)...
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: FireDitto in April 15, 2010, 05:46:14 VORMITTAG
Lovely tip. =D
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Antes in April 18, 2010, 07:21:09 NACHMITTAGS
This is awsome ... thank you my friend
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: chrishicks in April 21, 2010, 12:28:32 NACHMITTAGS
Great tip. Tagging for future reference.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: USAFged in Mai 16, 2010, 01:53:48 NACHMITTAGS
I really like the way this displays in the Curve theme. I have mine setup without the submenus and it works great. I tried to do the same to the Core theme , but it displays vertically instead of horizontally. All the links are working but I need the menus to run horizontally and display them like the Core tabs . Not sure what to change.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in Mai 17, 2010, 12:38:56 VORMITTAG
Zitat von: USAFged in Mai 16, 2010, 01:53:48 NACHMITTAGS
I really like the way this displays in the Curve theme. I have mine setup without the submenus and it works great. I tried to do the same to the Core theme , but it displays vertically instead of horizontally. All the links are working but I need the menus to run horizontally and display them like the Core tabs . Not sure what to change.

The core theme and curve theme's CSS differs greatly. Basically it would have to be a different set of steps to incorporate this into Core (without the drop down magic).
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: bidzinski in Juni 03, 2010, 07:01:23 VORMITTAG
I like this, how do I get this on my forum? will I need to edit all the code?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Antechinus in Juni 03, 2010, 07:14:19 VORMITTAG
Zitat von: Scope XL in Mai 17, 2010, 12:38:56 VORMITTAG
Zitat von: USAFged in Mai 16, 2010, 01:53:48 NACHMITTAGS
I really like the way this displays in the Curve theme. I have mine setup without the submenus and it works great. I tried to do the same to the Core theme , but it displays vertically instead of horizontally. All the links are working but I need the menus to run horizontally and display them like the Core tabs . Not sure what to change.

The core theme and curve theme's CSS differs greatly. Basically it would have to be a different set of steps to incorporate this into Core (without the drop down magic).
Didn't see this earlier but it's not hard to do. Core doesn't include the dropmenu classes that this relies on. If you copy all the dropmenu classes from Curve's css to Core's css it should work (although you will still need a suitable button image). 

bidzinski, follow the instructions on the first page of the thread.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in Juni 03, 2010, 07:30:02 VORMITTAG
Zitat von: bidzinski in Juni 03, 2010, 07:01:23 VORMITTAG
I like this, how do I get this on my forum? will I need to edit all the code?

From the first post, yes.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: steve51184 in Juni 18, 2010, 12:18:25 NACHMITTAGS
hi all i've been getting these errors in my error log and have no idea how to fix them:

http://domain.com/index.php?action=search2
8: Undefined index: href
File: /var/www/Themes/default/index.template.php
Line: 618


http://domain.com/index.php?action=search2
8: Undefined index: title
File: /var/www/Themes/default/index.template.php
Line: 619


(i also get the above two errors for http://domain.com/index.php?action=register2)

and here's line 618 and 619:

<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>



would appreciate any help with this thank you :)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: FireDitto in Juni 26, 2010, 07:06:51 VORMITTAG
I wonder if perhaps someone could help me please?

I have a menu with 22 items in the main tabs.

I wonder if it is possible to create a second row of main menu tabs, and halve it, so each for has 11 tabs.

Menu:


Desired example:


Thanks =)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: lucas-ruroken in Juli 06, 2010, 06:28:31 NACHMITTAGS
Now... this is a mod?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in Juli 06, 2010, 07:15:18 NACHMITTAGS
Zitat von: zx71 in Juni 18, 2010, 12:18:25 NACHMITTAGS
hi all i've been getting these errors in my error log and have no idea how to fix them:

http://domain.com/index.php?action=search2
8: Undefined index: href
File: /var/www/Themes/default/index.template.php
Line: 618


http://domain.com/index.php?action=search2
8: Undefined index: title
File: /var/www/Themes/default/index.template.php
Line: 619


(i also get the above two errors for http://domain.com/index.php?action=register2)

and here's line 618 and 619:

<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>



would appreciate any help with this thank you :)

I am not receiving any of these errors, are you still using Curve default theme 2.0RC3?

Zitat von: FireDitto in Juni 26, 2010, 07:06:51 VORMITTAG
I wonder if perhaps someone could help me please?

I have a menu with 22 items in the main tabs.

I wonder if it is possible to create a second row of main menu tabs, and halve it, so each for has 11 tabs.

Menu:


Desired example:


Thanks =)

Interesting idea/suggestion, but this isn't what the trick accomplishes. To do this you will need another button array, and call both of them in index.template.php (assuming your css would even show the buttons in the manner you described).

Zitat von: lucas-ruroken in Juli 06, 2010, 06:28:31 NACHMITTAGS
Now... this is a mod?

This particular trick is not a mod, a similar trick has been made into a mod by someone, however it does not have the dropdown options mine offers. Feel free to take a look. http://custom.simplemachines.org/mods/index.php?mod=2564
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: lucas-ruroken in Juli 06, 2010, 08:22:49 NACHMITTAGS
ok perfect ^^

Thanks
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: davyj in Juli 27, 2010, 04:17:13 VORMITTAG

Nice tip!  Ping for later reading...
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: rocknroller in September 11, 2010, 10:21:11 VORMITTAG
greetings,

Is it passable with some parts of this code create dropdown MAIN MENU for CORE theme? maybe just structure without nice style?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Krysia in September 11, 2010, 06:10:52 NACHMITTAGS
This is absolutely fantastic, and should definitely be implemented into SMF!

I was able to add 7 menus (didn't need anymore) to the top. Fantastic. Some of the sub-menus are 12 items long, so the list works great. :)

Only downside: I wasn't able to figure out how to include some of the SSI includes into the sub-menus, but no big.

Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: flutter in Oktober 20, 2010, 12:14:45 NACHMITTAGS
I'm trying to do this but twice I have done the find and replace in dreamweaver and it can't find the lines I've to fix.  I'm sure it won't wok if I don't find them all.  I just upgrades to 2.0rc3 and everything is going ok (fingers crossed) just trying to mod it and really need a new menu item with drop down for downloads.

It was the last one on the index.template I couldn't find, along with the first subs one.  Any ideas why I won't have those lines.  I have tiny portal installed if that makes any difference
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in Oktober 20, 2010, 01:10:52 NACHMITTAGS
Zitat von: flutter in Oktober 20, 2010, 12:14:45 NACHMITTAGS
I'm trying to do this but twice I have done the find and replace in dreamweaver and it can't find the lines I've to fix.  I'm sure it won't wok if I don't find them all.  I just upgrades to 2.0rc3 and everything is going ok (fingers crossed) just trying to mod it and really need a new menu item with drop down for downloads.

It was the last one on the index.template I couldn't find, along with the first subs one.  Any ideas why I won't have those lines.  I have tiny portal installed if that makes any difference

Are you using Default Curve theme? Or at least a Curve based theme? If not it probably won't work. Instead of searching for the entire line, try searching for part of the line (just make sure there are no other occurances of what you search for). Tinyportal may replace some of my edits with there own code, in which case you will need to adjest accordingly. But yea, my best guess is searching for part of the line and deciphering what needs to be changed will be your best bet. Let me know how it goes.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: flutter in Oktober 20, 2010, 02:02:57 NACHMITTAGS
well I just got this and from what I could make out the curve theme was the default theme.  Tha't what I'm using, though it says core theme.

If I change stuff that tiny portal has done, will it not break the portal, and if I just skip the things that aren't there, won't this just not work?  It's hard ot get a forum just how you want it

Thank you for getting back to me
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in Oktober 20, 2010, 06:08:05 NACHMITTAGS
Its hard to say. It won't hurt to try if you make a backup of each file you make changes too. And then if you do run into a problem jut revert back ot the original file.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Draffi in November 03, 2010, 02:28:52 NACHMITTAGS
Really, nice tip ! Thank you... :-*

But somebody have an idea how to make this (main) tabs active ?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: photocu in November 08, 2010, 02:47:13 NACHMITTAGS
Has anyone updated this for RC4?

Del
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: photocu in November 08, 2010, 04:41:21 NACHMITTAGS
This still works for me in RC4.  Just had to go back and add the edits to subs.php.

Del
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Draffi in November 09, 2010, 05:01:52 NACHMITTAGS
How can i make this buttons (for this additional menu in the top right corner) active, when i visit a page ?

(For example look the picture, please)

(http://img602.imageshack.us/i/activebutton.png/)

Uploaded with ImageShack.us (http://imageshack.us)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in November 10, 2010, 01:30:14 VORMITTAG
I didn't build this modification to allow for that, I assume you will need to use some form of the CSS active_button, but in this mods current form, this cannot be accomplished.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in November 21, 2010, 03:20:46 NACHMITTAGS
I added all of the code without errors, but the menu doesn't show still.  I had the SMF logo suppressed from the get go though.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in November 21, 2010, 03:28:09 NACHMITTAGS
try to echo anything where the menu should go. You could have a style that is setting display:none; possibly. Make sure its not nested between <!-- (menu code) --> HTML tags either, then it will just get ignored.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in November 21, 2010, 03:37:05 NACHMITTAGS
Zitat von: Scope XL in November 21, 2010, 03:28:09 NACHMITTAGS
try to echo anything where the menu should go. You could have a style that is setting display:none; possibly. Make sure its not nested between <!-- (menu code) --> HTML tags either, then it will just get ignored.

It works on the regular curve theme but not my modified curve theme (RGBB Curve).
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in November 21, 2010, 06:49:46 NACHMITTAGS
Yea, I only designed it to work with default Curve. No curve variations have been tested. Theoretically if its a true curve variation it should work with minimal differences in the code edits.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Deaks in November 23, 2010, 09:53:02 VORMITTAG
colby this should work for your theme post the fukes you edited and we can check the code.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: MarcusJ in November 23, 2010, 10:24:04 VORMITTAG
I've made these edits on RC4, but only to the theme I am currently using.  It is curve based, but the menu is being aligned on the left side.

Do I need to edit the default template & my current theme? 

Also does anyone have a thought about why the menu isn't aligning properly?  It was working perfectly before on RC3.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in November 24, 2010, 07:31:23 VORMITTAG
Zitat von: Runic in November 23, 2010, 09:53:02 VORMITTAG
colby this should work for your theme post the fukes you edited and we can check the code.

I had it working to the point at which it was directly under the dashboard carrot ^, no drop-down links were working, and the My Messages didn't show the number of new PMs.  I can figure out the last part as that has to do with subs.php, but why didn't the placement nor the drop-down links work?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in Dezember 14, 2010, 02:12:54 NACHMITTAGS
Zitat von: Scrooge in November 23, 2010, 09:53:02 VORMITTAG
colby this should work for your theme post the fukes you edited and we can check the code.

Fukes?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in Dezember 14, 2010, 02:18:51 NACHMITTAGS
I was able to get it working for my curve variation.  How do I remove the original menu, so that I don't have two menus?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in Dezember 14, 2010, 04:02:53 NACHMITTAGS
Zitat von: colby2152 in Dezember 14, 2010, 02:18:51 NACHMITTAGS
I was able to get it working for my curve variation.  How do I remove the original menu, so that I don't have two menus?

To clarify.. I am using this mod to move my forum menu up to the very top.  I then want to remove the forum menu in addition to the news/search/user-info sections.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in Dezember 15, 2010, 12:55:57 NACHMITTAGS
Okay, so I have added the navigation menu to the top but one key problem... items like the number of new messages in brackets to the right of Messages do not appear.  Likewise, the logout / login-register buttons are not showing.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: colby2152 in Dezember 19, 2010, 08:56:07 NACHMITTAGS
No feedback?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: tennis4you in Januar 06, 2011, 09:12:24 NACHMITTAGS
Is there any way this can be made a mod?  This would be an amazing one!
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: steve51184 in Februar 25, 2011, 01:09:48 NACHMITTAGS
hi i have this installed on my forum and have been suing it for quite some time and i'm now having problems after changing smf's cache settings (apc)

it was on the default '1' but i changed it to '3' but now not matter if i have it set to 1,2 or 3 the menu just won't show

i've tried to clear the cache before and after but the only way i can get the menu to show now is to disable the cache

any ideas?

here's a few of the errors i get with cache set to 1,2 or 3:

error1:

8: Undefined variable: menu_buttonsTop
Apply Filter: Only show the errors from this file
File: /var/www/web8/web/Sources/Subs.php
Line: 4637


line 4637 from Subs.php:

$context['custom_menu_buttons'] = $menu_buttonsTop;

error2:

2: Invalid argument supplied for foreach()
Apply Filter: Only show the errors from this file
File: /var/www/web8/web/Themes/default/index.template.php
Line: 572


line 572 from index.template.php:

foreach ($context['custom_menu_buttons'] as $act => $button)
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: CapadY in Juni 04, 2011, 11:38:29 VORMITTAG
Zitat von: MarcusJ in November 23, 2010, 10:24:04 VORMITTAG
I've made these edits on RC4, but only to the theme I am currently using.  It is curve based, but the menu is being aligned on the left side.

Maybe somebody solved this ?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Masterd in Juni 04, 2011, 12:03:30 NACHMITTAGS
Zitat von: CapadY in Juni 04, 2011, 11:38:29 VORMITTAG
Maybe somebody solved this ?

Actually, I did.

#top_section
{
min-height: 65px;
/*overflow: hidden;*/
margin-bottom: 3px;
}
#site_menu
{
padding: 12px 0 4px 1em;
margin: 0;
/*overflow: hidden;*/
font-size: 1.1em;
font-family: tahoma, sans-serif;
float: right;
}
h1.forumtitle
{
font-family: "Century Gothic", tahoma, sans-serif;
position: absolute;
}
#main_menu
{
margin-top: 1em;
}
#site_nav li a.active
{
background: url(../images/theme/menu_gfx.png) no-repeat 100% -31px;
}
#site_nav li a.active span.firstlevel
{
background: url(../images/theme/menu_gfx.png) no-repeat 0 -31px;
}
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: CapadY in Juni 04, 2011, 12:58:34 NACHMITTAGS
Great, thank you very much.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Masterd in Juni 04, 2011, 01:00:16 NACHMITTAGS
No problem! ;)

It was a very simple fix.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: semyon19 in Juni 08, 2011, 10:17:00 VORMITTAG
How is work on RC5? I am did steps, writed in first message of this topic, but is not work. More errors of them. First on subs.php, second - on index.template.php Anybody know, how it solved for Curve RC5?

Thanks
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Masterd in Juni 08, 2011, 10:49:35 VORMITTAG
I got no errors on SMF 2.0 RC5. Wich mods do you have installed?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: semyon19 in Juni 08, 2011, 01:07:40 NACHMITTAGS
ResizeImagesToFitScreen    0.1.6
YouTube BBCode    2.6
Board Viewers Mod    1.2.1.1b
SimplePortal 2.3.3
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Masterd in Juni 08, 2011, 03:55:10 NACHMITTAGS
Did you followed all steps carefuly? Wich errors do you get?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: semyon19 in Juni 09, 2011, 09:43:43 VORMITTAG
Fatal error: Call to undefined function cache_get_data() in /home/virtwww/w_sdvigpolysov-ru_62a2c6b7/http/Sources/Subs.php on line 4388

If i am back up Subs.php, then on my forum the "logo" is moved on personal info (hello user, avatar, etc).

sdvigpolysov.ru is my forum.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: semyon19 in Juni 10, 2011, 10:46:29 NACHMITTAGS
So, anybody can help me?
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: semyon19 in Juni 11, 2011, 01:44:01 VORMITTAG
I am re-install all smf2.0 rc5 files without any mods, and setup all steps, and error is still on forum.

Fatal error: Call to undefined function cache_get_data() in /Sources/Subs.php on line 4200
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: semyon19 in Juni 12, 2011, 03:01:40 VORMITTAG
Somebody try to setup this top menu on 2.0? I am dont. Its not worked, its worked with errors.

Fatal error: Call to undefined function cache_get_data() in Sources/Subs.php on line 4337
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: semyon19 in Juni 12, 2011, 03:20:47 VORMITTAG
I think this is wrong code in Subs.php by autor.

if (($menu_buttons = cache_get_data('menu_buttons-' . implode('_', $user_info['groups']) . '-' . $user_info['language'], $cacheTime)) === null || time() - $cacheTime <= $modSettings['settings_updated'])
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: ScopeXL in Juni 12, 2011, 03:27:53 NACHMITTAGS
I don't understand why you would be receiving this error. cache_get_data() is a primary function in Sources/Load.php Open that file and make sure it isn't commented out (maybe from another mod?) and then try and see if you receive that error.

Here is the function from SMF Function DB: http://support.simplemachines.org/function_db/index.php?action=view_function;id=76

Let me know if it works for you.
Titel: Re: [Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3
Beitrag von: Rain Forest in November 06, 2014, 08:46:13 VORMITTAG
Zitat von: steve51184 in Juni 18, 2010, 12:18:25 NACHMITTAGS
hi all i've been getting these errors in my error log and have no idea how to fix them:

http://domain.com/index.php?action=search2
8: Undefined index: href
File: /var/www/Themes/default/index.template.php
Line: 618


http://domain.com/index.php?action=search2
8: Undefined index: title
File: /var/www/Themes/default/index.template.php
Line: 619


(i also get the above two errors for http://domain.com/index.php?action=register2)

and here's line 618 and 619:

<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>



would appreciate any help with this thank you :)

Got the same error.


for title
<span class="', isset($button['is_last']) ? 'last ' : '', 'firstlevel">', $button['title'], '</span>


for href


<a class="', $button['active_button'] ? 'active ' : '', 'firstlevel" href="', $button['href'], '"', isset($button['target']) ? ' target="' . $button['target'] . '"' : '', '>


Those errors seem to appear in error log when someone is using the 'search' button/searchbox.