Simple Machines Community Forum

SMF Support => SMF 2.0.x Support => Topic started by: ToxicDocter on August 25, 2020, 03:23:36 AM

Title: Drop down menu
Post by: ToxicDocter on August 25, 2020, 03:23:36 AM
So ive been trying to change the drop down menu from the Dropdown Navbar to a Subnav (Posted a pic). Is there a way to get this?
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 03:35:54 AM
Sure. That's just presentation. Short version: remove the width restriction on your drop menu, and set the li's to display: inline-block;

That will get you a basic dropline, after which it's just a case of tweaking the eye candy until it looks just how you want it.

Do note that although they're fine on touchscreen, they tend to be a bit of a PITA with a mouse. That's because you have to track around a right angle corner to get to the links, which isn't as natural. You can alleviate this by going with click activation instead of hover, which allows tracking the cursor diagonally straight to the link you want, but it's still a little more awkward.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 03:44:05 AM
ok where do i go to do that
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 03:45:25 AM
What theme are you using?
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 03:52:17 AM
Curve
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 03:53:08 AM
Ok, hang on and I'll fire it up on local.
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 04:23:21 AM
If you add this to the end of index.css it will give you the basics.

.dropmenu {
position: relative;
}
.dropmenu>li {
position: static;
}
.dropmenu li ul {
width: 100%;
box-sizing: border-box;
left: 0;
background: #fff;
border: 1px solid #999;
}
.dropmenu li li {
width: auto;
float: none;
position: static;
display: inline-block;
border: 0;
}
#admin_menu ul ul {
margin: 0;
}
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 04:31:40 AM
Didnt do anything
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 04:32:49 AM
Hard refresh your browser.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 04:36:05 AM
still nothing did it from chrome and internet explorer
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 04:41:00 AM
I got it now was missing a line of code
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 04:42:43 AM
Good. :)
As I said, this is just basic functionality. Up to you how much eye candy and other trickery you want to add.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 04:59:53 AM
Will that code work for all themes?
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 05:11:02 AM
The basic principles should, but different themes may use different structures, classes and id's for their menus. It depends on the whims of the theme's author. So the answer is a maybe, but probably ends up being a no in a lot of cases. But even when it's a no, you can still adapt the idea to work with that theme.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 05:32:21 AM
could you do possibly one more?
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 05:34:14 AM
Ok. Lay it on me.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 05:35:42 AM
its Deception the theme is no longer available tho so idk if you will be able to do it
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 05:36:50 AM
I'll take a look around.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 05:41:07 AM
I'm running the theme now I'm my website just can't get the colors right
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 05:41:08 AM
Can't see any downloads of it anywhere. Do you have a copy of it?

Or just link me to your site. That would work too.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 05:43:10 AM
http://infantrygaming.com/
Title: Re: Drop down menu
Post by: Antechinus on August 25, 2020, 06:04:50 AM
  #topnav li {
    position: static;
  }
  #topnav li ul {
    position: absolute;
    width: 40em;
    left: 0;
  }
  #topnav li li, #topnav li:hover li {
    float: none;
    width: 220px;
    display: inline-block;
  }
Title: Re: Drop down menu
Post by: @rjen on August 25, 2020, 06:19:36 AM
Quote from: ToxicDocter on August 25, 2020, 05:43:10 AM
http://infantrygaming.com/

Where is the copyright notice gone to?  ::)
Title: Re: Drop down menu
Post by: Arantor on August 25, 2020, 06:43:18 AM
I also like the dirty hack to remove index.php from the URL guaranteeing that first time users are served with no theme.
Title: Re: Drop down menu
Post by: @rjen on August 25, 2020, 07:29:13 AM
Quote from: Arantor on August 25, 2020, 06:43:18 AM
I also like the dirty hack to remove index.php from the URL guaranteeing that first time users are served with no theme.

Ha, I was wondering why that happened... yuck.
Title: Re: Drop down menu
Post by: Arantor on August 25, 2020, 07:55:04 AM
Yup, if you hack QueryString.php to change the definition of $scripturl to not have index.php in it, this happens. The mod which does it does this too, which is why I kept asking for it to be removed.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 11:23:36 AM
Quote from: @rjen on August 25, 2020, 07:29:13 AM
Quote from: Arantor on August 25, 2020, 06:43:18 AM
I also like the dirty hack to remove index.php from the URL guaranteeing that first time users are served with no theme.

Ha, I was wondering why that happened... yuck.
Thanks for letting me know about that and the copyright i was messing around in the template
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 11:30:22 AM
Quote from: Antechinus on August 25, 2020, 06:04:50 AM
  #topnav li {
    position: static;
  }
  #topnav li ul {
    position: absolute;
    width: 40em;
    left: 0;
  }
  #topnav li li, #topnav li:hover li {
    float: none;
    width: 220px;
    display: inline-block;
  }

I combined the 2 and added a subnav is there stuff thats not needed in there?


}
.dropmenu {
   position: relative;
}
.dropmenu>li {
   position: static;
}
.dropmenu li ul {
width: 100%;
box-sizing: border-box;
left: 0;
border: 1px solid #999;
}
.dropmenu li li {
   width: auto;
   float: none;
   position: static;
   display: inline-block;
   border: 0;
}
#admin_menu ul ul {
   margin: 0;
}
  #subnav {
   position: fixed;
   float: left;
   overflow: hidden;
  }
  #topnav li {
   position: static;
}
  #topnav li ul {
    box-sizing: border-box;
    width: 100%;
    left: 0;
    border: 1px solid #999;
  }
  #topnav li li, #topnav li:hover li {
    float: none;
    width: auto;
    position: static;
    display: inline-block;
    border: 0;
  }
   margin: 0;
}
Title: Re: Drop down menu
Post by: Kindred on August 25, 2020, 11:36:59 AM
not sure what this is
Quote
Copyright © 2020 Simple Machines. All Rights Reserved.

We don't own a copyright to anything on your site...  only to the software.   So adding that line is improper.
Quote
SMF 2.0.17 | SMF © 2019, Simple Machines

this is the only copyright that we expect to see.
Title: Re: Drop down menu
Post by: ToxicDocter on August 25, 2020, 01:16:05 PM
ok thanks i changed it so hopefully its good now
Title: Re: Drop down menu
Post by: Kindred on August 25, 2020, 03:00:40 PM
why do you have anything manually in there at all?

the automatic copyright notice was restored and is displayed... you don't need a manual one as well.