XF 2.1 How to detect browser (mobile) and force style?

BuildBridges

Active member
There used to be a native function in Xenforo 1.5 but I can't seem to find it in Xenforo 2.1.

I'd like to have two different styles, one for MOBILE and one for DESKTOP.

Before any content is rendered, the system detects the device and delivers the appropriate style.

Since Google places a heavy emphasis on mobile speed, I view this functionality is imperative since content consumption is vastly different dependent on device.

There's an add on in the resource center but it is unmaintained and reported to create errors.

Using media queries (display:none) doesn't appear to be the solution since the content is still generated, but just hidden.

Any ideas?
 
Hello,

You should try this :

Regards, SyTry
 
Hello,

You should try this :

Regards, SyTry

Thank u, I did see that on my search however I was not sure how to deploy that to force a style.
 
I can't imagine something so fundamental to page speed and a good Google ranking is unavailable, not as a part of the Xenforo core or as a part of an add on.

If any developer wants to get paid to create a solution, message me.
 
There really is no need for a separate style for mobile, XF is responsive and mobile friendly OOB.

I tend to take the lead on what Google suggests. Xenforo's native style doesn't score well when analyzed in their Page Speed tool.


The mobile style would be limited in graphics, widgets, and other stuff to improve the rating.

Any image customization or style enhancements drop the Google speed rating to under 50. This impacts indexing and page rankings.

If you can find any heavily customized Xenforo installation that rates higher than 65, much less 60, I'd like to see it.

I've yet to find one.
 
Thank you for the examples but these are small product based websites with little traffic. Our site is pretty large and content focused, where content exposure is the priority. A parallel example in terms of size and customization would be AVForums.com (which BTW has a score of 13).

Some small graphic/color customizations on Xenforo's native style would never work.

I was looking for something larger with a content focus, a website has a million posts or more and is content oriented, not product.
 
They score terrible according to page speed insites, do you think it hurts them?

I'm sure it doesn't help, but having dedicated mobile apps for their content does. They have also have a mobile version (which also scores poorly).

Many people have heard of IGN and their forum isn't their business, or their central home page. IGN, in itself, is a search term and with 23K+ inbound links, I'm sure Google's Page Speed Insights isn't their priority. And I wouldn't expect it so.

1562028832953.png

My guess is that a lot of their traffic are repeat visitors with brand familiarly, and/or brand loyalty.

I'm sure major brands aren't terribly concerned with Page Speed because when I want a Ford, I don't google Ford, I goto Ford.com.
 
They score terrible according to page speed insites, do you think it hurts them?

Do they use GoogleAds? ;)

But here:
There are 20 points difference between desktop and mobile style, that's quite remarkable. Especially if you need Google
We are also looking for a solution here.

And:
There is a difference because Google does not only pay attention to the homepage

1 Homepage
...
2. Thread
 
Last edited:
Top Bottom