XF 2.2 Hide a specific Widget on mobile

ScrapDog

Member
Hello,

Is there some way to hide an widget from mobile devices. So lets say: i made a widget in "widgets" , but it is not fitting on mobile devices. Is there a way to hide the widget for mobile devices ? I have searched for "display conditions", but i cant find or understand that.

Sincerely,

ScrapDog
 

Brogan

XenForo moderator
Staff member

ScrapDog

Member
One way is to add the widget directly to the template using: <xf:widget key="widget_key" />.

You can then apply a class to that to prevent it showing below a certain width.

Or check the Advanced mode option and manually create the widget style, adding a media query class at the same time.
See this post for how do to that: https://xenforo.com/community/threa...der-a-certain-page-width.186472/#post-1469090
Okay , but now i need to hide , i can place it but what is the syntax for it, now i have:

<xf:widget key="FileServer" />

I placed that in the template of page_container.
 

ScrapDog

Member
So it works now, many thx .....

Now i need to see that widget only on the homescreen of the forum, it shows everywhere i go now. is that possible also ??

Regards,

ScrapDog
 
Last edited:
Top