XF 1.2 Responsive Design

In order to better support smaller-screen devices such as mobile phones and tablets, XenForo 1.2 will be introducing a responsive version of the default design.

What is responsive design? At the simplest level, it allows you to specify CSS that applies only if the screen width is below a certain level. This allows the design to be significantly altered to fit smaller screens. For example, tabular or horizontally-focused designs don't work well when you only have a screen that's 320px wide (an iPhone).

So, what options will XenForo provide?

ss-2013-05-24_11-33-30.webp


Here you can see that we provide 3 "inflection points". In general, they correspond to particular classes of devices.
  • Narrow (max width: 480px): phones vertical, some phones horizontal
  • Medium (max width: 600px): some phones horizontal, 7" tablets vertical
  • Wide (max width: 800px): 7" tablets horizontal, 10" tablets vertical
You can also disable the responsive design entirely. Specific pages can also opt out of the responsive design with a <xen:container /> line.

For add-on developers, many of your pages will automatically support the responsive design well. It really depends how much "default" CSS you are using. If you are creating multi-column layouts (such as some resource manager pages), you will need to write custom responsive versions. However, if you're just using standard systems like tabs and forms, you will automatically inherit the responsive changes.

The extent of changes on a page will really vary based on the width of a device. For example, "wide devices" (601-800px by default) will see mostly similar pages, but things like sidebars will be moved if needed.

But this is really more about screenshots. For ease of my job, I'm taking these screenshots in Chrome on a desktop machine. :) As always, this is a work in progress and things are still subject to change.

ss-2013-05-24_11-45-57.webp


This part does deserve special mention as it's very dynamic now. The short of it is that if there's not enough space to fit things (at any resolution), navigation/search options will be hidden as necessary and shown behind menus. User alerts/unread conversation counts will be folded into your user menu. If there is a selected navigation tab, it will always be shown as well.

These screens are all taken at the "narrow" level to show you the full extent of the possible changes.

ss-2013-05-24_11-49-35.webp ss-2013-05-24_11-50-00.webp ss-2013-05-24_11-50-46.webp ss-2013-05-24_11-51-04.webp ss-2013-05-24_11-52-22.webp ss-2013-05-24_11-53-06.webp ss-2013-05-24_11-53-36.webp
 
One thing I really dislike about the responsive design is making it a 2-click process to check your alerts (one of the most performed actions).

It's make much more sense to have a little red bubble just before your username name that was clickable and use up very little real estate.
 
The whole page going blank white, then the youtube video being in the middle. It was in one of erich's posts in the random thoughts thread.
 
Out of all the new features I can see, so far, in 1.2, this is by far my favorite. You guys did a great job with this, from what I've seen so far. Browsing on my phone is a LOT easier now. I don't have to keep turning it and resizing it to do what I'm trying to do. Works great for me. Great work, guys!
 
Has anyone tried using Responsive Design with Samsung's Galaxy phone(s) or similar phones? If so, tell me if it works!
 
So is js the only way we'll be able to have conditionals based upon the screen size, no template conditionals at all? For example, if we wanted to use a different header logo when the smaller screen sizes dynamically.
 
So is js the only way we'll be able to have conditionals based upon the screen size, no template conditionals at all? For example, if we wanted to use a different header logo when the smaller screen sizes dynamically.

you can't do this without javascript because it needs to be done on client side.
you "could" probably detect the width via js, send it via ajax to the server and save it for the current session and use it THEN inside your php code.
 
you can't do this without javascript because it needs to be done on client side.
you "could" probably detect the width via js, send it via ajax to the server and save it for the current session and use it THEN inside your php code.
I have to imagine there is an easier way; since the templates are being presented differently based upon the width thresholds in the ACP (eg: the postbit is on top instead of the left when viewed on a mobile device) I am thinking that there must be a conditional of some type we could easily use. I'm not even talking PHP code for add-ons, just straight template changes.
 
It seems like its going to cause lots of difficulties if there's no way to have conditionals in the templates.

Can the returned value from the js that's used be passed back so the templates can use it? Or do you mean it's only determined after the templates have been processed ?

Not being able to show mobile ads is a show stopper which I'm sure they'll be a solution for but also things like different sized images, logos, etc would be a pain. E.g. We display John's twitter header with a background image defined on the CSS to make it look like a "breaking news" banner. That obviously would be no good on the mobile style as the banner image is 800px wide.
 
It seems like its going to cause lots of difficulties if there's no way to have conditionals in the templates.

Can the returned value from the js that's used be passed back so the templates can use it? Or do you mean it's only determined after the templates have been processed ?

Not being able to show mobile ads is a show stopper which I'm sure they'll be a solution for but also things like different sized images, logos, etc would be a pain. E.g. We display John's twitter header with a background image defined on the CSS to make it look like a "breaking news" banner. That obviously would be no good on the mobile style as the banner image is 800px wide.

These are exactly my questions as well. Love the fact that Xenforo are adding all these great features and taking mobile seriously, but I am not sure how I can implement responsive with Google Adsense and custom headers and logos.
 
These are exactly my questions as well. Love the fact that Xenforo are adding all these great features and taking mobile seriously, but I am not sure how I can implement responsive with Google Adsense and custom headers and logos.

Thats my concern as well.
 
These are exactly my questions as well. Love the fact that Xenforo are adding all these great features and taking mobile seriously, but I am not sure how I can implement responsive with Google Adsense and custom headers and logos.

Google allows for conditional adsense code.

For custom headers and logos you would just link to a different header based on the screen size.
 
Top Bottom