Site Builder and Mobile Devices

TiG
TiG
@tig
6 years ago
184 posts
Adjusting the presentation (and content) to accommodate mobile devices is easy to do while using SB. Two things, however, seem to be out of reach when trying to scale down a page (in our case, the home page) for mobile devices.

First, there seems to be no way to conditionally hide a widget. Hiding the contents of a widget is trivial but the widget (its label) still shows up. Ideally there would be a 'Settings' option for Mobile | Tablet | Monitor which would allow us to uncheck Mobile so that the widget would then never render on any device that matches jrCore_is_mobile_device.

I am open for any thoughts you may have that allow me to not render select widgets for mobile devices.

Second, it would be quite powerful to be able to reorder widgets based on device type (even if we limit it to mobile and tablet as defined by the associated JR functions). This would, in effect, be equivalent to allowing us to design a SB page for standard monitor devices, another one (optionally) for tablets and yet another (optionally) for mobiles.

That is ideal and I do not expect it exists. I am just looking for suggestions on how to proceed. I have searched the forum and have not discovered much insight on this particular aspect.

----------------------

So, at the minimum, is there a way to conditionally hide an SB widget based on jrCore_is_mobile_device?

Thanks.


--
TiG

updated by @tig: 06/13/18 09:16:28PM
michael
@michael
6 years ago
7,714 posts
first thought is CSS in the mobile CSS. Each widget has a uniquie ID, maybe hide the ones you dont want. Good suggestion. There currently isnt a way to add custom classes to the widget, but its a good idea.

--
Possible to do via skin and template adjustment, but not via the Site Builder system currently.

--
Only if you're using the TEMPLATE CODE widget, other widgets dont have access to template functions like {jrCore_is_mobile_device}
brian
@brian
6 years ago
10,148 posts
Yeah you can definitely do some of this in CSS since each widget has a unique ID.

I'm hesitant to add this directly to Site Builder though - it's just not something anyone else has needed. My worry is someone sets a widget to be "mobile only" and doesn't see it and it becomes a support issue. Site Builder is designed for those that aren't technical - more technical choices typically isn't a good idea.

But we'll definitely check it out. Thanks!


--
Brian Johnson
Founder and Lead Developer - Jamroom
https://www.jamroom.net
TiG
TiG
@tig
6 years ago
184 posts
@michael

That gets me in the ballpark. It is valuable to know what is / is not possible (saves considerable searching time). Thanks for again sharing your expertise.

@brian

I understand. It is a delicate balancing act - the more functionality (the more configurable options) the more chance for errors and misunderstanding. ( Although since users can currently insert their own template code (and simple db queries) in SB that opens up a ton of potential errors right there. So you might already be well past the point where device-sensitive configuration options add significantly to the risk. )

As you know, I sort of inherited a site set up for owner-configuration. I have been migrating the site to a strictly file-based system so that PHP Storm can 'see' all the operative code and, if I had started from scratch, I probably would have rolled my own bootstrap structure rather than use SB.

Perrie still directly uses SB so I will work around it to meet site needs. Thanks to you both for the advice.


--
TiG
alt=
K_K
@k-k
6 years ago
95 posts
One vote from me too for this if you are considering to make changes, I would also love to be able to make a different version of the front page for mobile devices in Site Builder.

For example I am running a three column front page with the center column wide with news and side columns narrow for several different types of content. That works well for desktop browsers, the center column with news takes the immediate attention.

For mobile devices with one column shown the news are very far down in the page. Being able to change the order of the widgets would help a lot. Hiding some would also be a good option to have.

Tags