News:

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

Main Menu

[Tip] Additional Dropdown Menu for Curve Theme 2.0 RC3

Started by ScopeXL, January 15, 2010, 02:12:21 AM

Previous topic - Next topic

~DS~

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.  ;)
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

navjotjsingh


diamondred123

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
Learner but knows a little

~DS~

ScopeXL, is there any way to hide lines from guests?
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

ScopeXL

Quote from: Dismal Shadow on February 25, 2010, 06:43:36 PM
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.

ScopeXL

@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.

~DS~

Quote from: ScopeXL on February 25, 2010, 07:18:17 PM
Quote from: Dismal Shadow on February 25, 2010, 06:43:36 PM
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.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

ScopeXL

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.

~DS~

What about the tabs? Are you saying this code now has the ability to have more than 4 tabs?
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

ScopeXL


steve51184


ScopeXL

Quote from: zx71 on February 25, 2010, 09:15:33 PM
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.

~DS~

"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

diamondred123

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
Learner but knows a little

ScopeXL

#34
Quote from: diamondred123 on March 02, 2010, 04:26:05 PM
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.

diamondred123

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
Learner but knows a little

~DS~

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
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

ScopeXL

Quote from: Dismal Shadow on March 05, 2010, 05:37:03 AM
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.

~DS~

Quote from: ScopeXL on March 05, 2010, 05:43:50 AM
Quote from: Dismal Shadow on March 05, 2010, 05:37:03 AM
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.
"There is no god, and that's the simple truth. If every trace of any single religion were wiped out and nothing were passed on, it would never be created exactly that way again. There might be some other nonsense in its place, but not that exact nonsense. If all of science were wiped out, it would still be true and someone would find a way to figure it all out again."
~Penn Jillette – God, NO! – 2011

ScopeXL

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.

Advertisement: