XF 2.3 Is there a way to make a widget only show if the user is on mobile?

cdub

Well-known member
Is there a way to make it so a certain widget only shows up on mobile?

For example I have widgets in the sidebar that are easily viewable on desktop on the main page but on mobile one has to scroll to the bottom to see them. I'd like them to be higher up on mobile but don't want duplicate widgets on desktop view.

Is there a way to do this?
 
We've used Xon's Browser Detection add-on (which is Mobile-Detect under the hood) for a few bits like this in the past (a Display condition like $xf.mobileDetect && $xf.mobileDetect.isMobile() doing the trick). Seems to work quite well for our user-case. That will at least let you pick and choose which widgets are shown on which platforms. Positioning is of course dependent on which slot you pop them (although as an aside I did see an add-on the other day that let you move the sidebar into various different positions which looked quite niffty)
 
Back
Top Bottom