SimplePortal

Customization => Blocks and Modifications => Block Requests => Topic started by: Burke Knight on May 19, 2015, 07:37:35 AM

Title: Menu Block to show for Mobile Devices Only
Post by: Burke Knight on May 19, 2015, 07:37:35 AM
I'd like to have a Menu Block to show for Mobile Devices Only.
Since most phones and drop down menus do not like each other that well, I figure a SP menu block would work out well. However, I only want it to show on mobile devices, as it will not be needed for regular computers.
Title: Re: Menu Block to show for Mobile Devices Only
Post by: ♦ Ninja ZX-10RR ♦ on May 19, 2015, 12:22:55 PM
I don't think a block would be the way, really. I think it should be the theme to be made responsive, showing an alternative menu according to resolution, it has been done before.
Basically, something like this: http://simpleportal.net/index.php?topic=13934.msg69009#msg69009
Title: Re: Menu Block to show for Mobile Devices Only
Post by: Burke Knight on May 20, 2015, 06:57:47 AM
I'm not worried about passing some stupid "mobile friendly" junk of Google.
I just want a menu block, to show ONLY for mobile devices, since the drop down menu seems to open the top level while opening the drop down, making it so can't tap the drop down choices.
Title: Re: Menu Block to show for Mobile Devices Only
Post by: ♦ Ninja ZX-10RR ♦ on May 20, 2015, 07:33:44 AM
I understood that, the answer doesn't really change I'm afraid. The topic I have linked above is strictly related to this question, even if the title says different it applies to this case quite a lot. What you need to do is something similar to what has been done in the reply I linked, showing only for resolution<X.

If you still want a block you could use the block id as a css selector and add it to your portal.css, making it look like this:
Code: [Select]
@media only screen and (max-width: 750px), only screen and (min-resolution: 300dpi) {

#sp_block_X {
css properties here;
}
}
Just replace X with your block ID, if you want to go down this path :)
Title: Re: Menu Block to show for Mobile Devices Only
Post by: Burke Knight on May 20, 2015, 07:50:41 AM
Yes, the answer WILL change.
I am not looking to change how blocks are displayed to mobile devices.
Far as I'm concerned, the site looks fine as is.
The issue I am having, is the MENU, as it won't work correctly, due to tapping not beign like a mouse, and able to hover to open the drop down, so they can select a choice.

So, I plan on using one of the menu blocks that SP has in the choices.
However, I don't want it to show for everyone, just those using mobile devices.
So, I need a modified menu block.
Title: Re: Menu Block to show for Mobile Devices Only
Post by: ♦ Ninja ZX-10RR ♦ on May 20, 2015, 09:57:14 AM
[ndr]The conversation carried on privately

Well given that you can use that menu block you can just add that simple css code and be done with it :) Something like:
Code: [Select]
#sp_block_ID
{ display: none;}
@media only screen and (max-width: 750px), only screen and (min-resolution: 300dpi) {

#sp_block_X {
css properties here;
}
}
Title: Re: Menu Block to show for Mobile Devices Only
Post by: Burke Knight on May 20, 2015, 11:05:00 AM
Well, it ended up being a moot point, anyway.
The SP menu block still utilizes drop down, which is what the issue is.
Seems a change in the top level links, to just # then all the sub-menu items being regular links, works.
Title: Re: Menu Block to show for Mobile Devices Only
Post by: ♦ Ninja ZX-10RR ♦ on May 20, 2015, 01:07:50 PM
I don't get whether you actually did it or not ;D
Title: Re: Menu Block to show for Mobile Devices Only
Post by: Burke Knight on May 20, 2015, 03:18:17 PM
Well, I set most of the menu to have the top level links not be links, by setting them to # for the URL.
This makes it so when tapped, it'll open the drop down, but not try to load a link.
If check out the main site on mobile, you'll see.

Since I use Menu Editor Lite, it's easy to work them. However, Admin, Moderate and Profile, are ones that I had to leave as is, since they are permission based, set by the internal link in MEL. If was to change them, they'd show for people not supposed to see them, even if their links in drop down, would not work for them.

Was the fastest fix I could think of, but it works.
Title: Re: Menu Block to show for Mobile Devices Only
Post by: ♦ Ninja ZX-10RR ♦ on May 20, 2015, 03:19:49 PM
Given that they have their permissions in Subs.php I can't understand how they'd show for everyone though.
Title: Re: Menu Block to show for Mobile Devices Only
Post by: Burke Knight on May 21, 2015, 07:09:18 AM
Like stated, using Menu Editor Lite. :P

When setting up a Profile menu, it uses the settings, if use the Profile Internal link in MEL.
But, if I was to have that UNDER a different top lvl item, that item would show, not the real profile menu, but what I do as the top.
Title: Re: Menu Block to show for Mobile Devices Only
Post by: ♦ Ninja ZX-10RR ♦ on May 21, 2015, 08:35:17 AM
To be honest, I'll just edit the Subs.php and uninstall that mod, you are expert enough to do it without having your forum crashed ;)
Title: Re: Menu Block to show for Mobile Devices Only
Post by: Burke Knight on May 22, 2015, 01:13:48 PM
Ahhh, but there's plus sides to that mod.
An admin interface that's so much easier to deal with, under normal circumstances. ;)
Title: Re: Menu Block to show for Mobile Devices Only
Post by: ♦ Ninja ZX-10RR ♦ on May 22, 2015, 04:06:42 PM
I guess it's a Pros/Cons balance because I have no idea how to override its settings unless you edit it, but I have never used it so... :/ And yeah, I think it surely is much easier than editing a monster-like array list indeed ;D
SimplePortal 2.3.8 © 2008-2024, SimplePortal