News:

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

Main Menu

Move MESSAGES and ALERtS in SMF2.1 RC2 to the Nav Bar (Home Search Calendar, etc

Started by JeepExpeditions, March 10, 2020, 01:46:56 AM

Previous topic - Next topic

JeepExpeditions

The Message and Alert notification being at the top in the small default font are easy to miss.

How can I move these to the NAV Bar so the are larger and easier to see?

Anyway to make them pulsate if there are messages or alerts ?

Thanks in advance for any coding help you can provide.

Kindred

I don't think that is easily done....   the menu bar is not always present on the screen, while the topbar is.
Слaва
Украинi

Please do not PM, IM or Email me with support questions.  You will get better and faster responses in the support boards.  Thank you.

"Loki is not evil, although he is certainly not a force for good. Loki is... complicated."

JeepExpeditions

But the menu bar is viewable when you first sign in all the time and that is the most important for us.

Antechinus

Quote from: Kindred on March 10, 2020, 09:12:08 AM
I don't think that is easily done....   the menu bar is not always present on the screen, while the topbar is.

There should be ways around that. It'd be a matter of setting it up so the relevant bits stayed visible when the rest of the menu went to hamburger. Can't really see it being all that difficult, but would have to frig around with it a bit first.

Quote from: JeepExpeditions on March 10, 2020, 01:46:56 AM
Anyway to make them pulsate if there are messages or alerts ?

CSS animations (keyframes, etc).

Sir Osis of Liver

You can add messages and profile to main menu by copying code from 2.0 into buttons array in 2.1 Subs.php.  Didn't try moving alerts, that would be a bit different.
Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Antechinus

Just as a quick proof of concept, done with a few template hacks, the attached file seems to work. :)

JeepExpeditions

Quote from: Antechinus on March 13, 2020, 01:23:00 AM
Just as a quick proof of concept, done with a few template hacks, the attached file seems to work. :)

Thanks for the info,

I opened and looked at the lines of code.   What do I do with it ?    Replace the existing file or copy and paste specific lines and insert them in to the existing file in the correct spot, what ever that might be.

Sorry for being such a newb

Antechinus

No worries. Everyone starts somewhere.

If your current template has not been edited at all (either by a human or by a mod) you could just swap it for the one I attached (although make sure you have a backup copy of the original first).

If your current template has been edited, then it'd be a case of shunting the relevant bits around and adding a couple of tweaks.

In the latter case, just attach your current template and I'll take a look at it.

JeepExpeditions

Feeling confident,  I went and replaced the index.template.php file in the default themes.

It moved everything from the top down to the menu/nav bar.    Seems to work fine except now at the top it says "Welcome Guest, Log In" and I was logged in,  if I clicked on it a window opened up with a rectangular area with a spinning icon as if it was waiting for something.

Perhaps if we could move the profile back to the top as it was before,  then move messages and alerts from the end/right side of the menu bar to the left side just after "Home".

Can we increase the size of the buttons and fonts ?   Perhaps double what they are by default ?

Thanks again !

Sir Osis of Liver

Ashes and diamonds, foe and friend,
 we were all equal in the end.

                                     - R. Waters

Antechinus

Quote from: JeepExpeditions on March 13, 2020, 10:36:03 AM
Feeling confident,  I went and replaced the index.template.php file in the default themes.

It moved everything from the top down to the menu/nav bar.    Seems to work fine except now at the top it says "Welcome Guest, Log In" and I was logged in,  if I clicked on it a window opened up with a rectangular area with a spinning icon as if it was waiting for something.

Ok, fixed that. Try the new one. :)


QuotePerhaps if we could move the profile back to the top as it was before,  then move messages and alerts from the end/right side of the menu bar to the left side just after "Home".

That gets trickier, because of the way the menu is generated. It is far easier to just treat the profile/alerts/etc as a secondary menu. In 2.1 they're not really designed to be intermingled, so there would be a fair bit more coding involved.


QuoteCan we increase the size of the buttons and fonts ?   Perhaps double what they are by default ?

Sure, but double would be a bit much. I've reset them to standard browser default size (100%).

JeepExpeditions

That is PERFECT size!  Thanks so much !

Any chance I can get the User Name (profile), Messages and Alerts that you added to the menu moved to the left of the HOME button instead of the very end of the line ?

Thanks again !


JeepExpeditions

Perfect Antechinus !

This board is lucky to have people like you here !

Thanks again for everything !  ;D

Antechinus

No prob. Gets me thinking, it does.

One thought I had is that it wouldn't actually be that difficult to mix it up with the Home button to the left of the user profile bits. Requires a little bit of trickery, but not that much. If anyone wants to try it:

What you would do is make another Home button, which would just be another instance of ul class="dropmenu" dropped into the markup before your user profile. This ul would only contain the extra Home button, with most of the default button coding skipped in favour of doing it the simplest way. For example, you'd just call $scripturl for the href and you'd just call $txt['home'] for the text, rather than processing a pile of logic you don't need.

Give this sucker its own id="fake_home" or whatever you feel like calling it. Use CSS to knock out the default Home button with display: none; above 481px wide, and add a bit to responsive.css to bring it back on the mobile pop-up menu. Do the reverse with the new fake_home button, leaving it visible on larger screens and knocking it out on tiny ones.

This method would allow you to have any number of buttons either side of the user profile menu. However, having said all of that, I don't think it would be as good for users to mix it up like that. It occurred to me that the Home button is pretty much useless in practice anyway. There is always the whopping big h1 link up in the header, and there is always the linktree, so that's at least three other "home buttons" on every page and they are at least as accessible as the actual menu button. There would be a good argument for ditching this button from the menu in the interest of simplicity and saving space. :)

Advertisement: