0

I'm building a mobile site for a great magazine with a lot of content that is partly heavily. The problem now is that I have to hide the entire right column on the mobile site (yes, I need it in this case).

I've done a great research on mobile design, read a lot of articles, but can't find a solution that addresses this problem. It's usual to hide the right column with CSS or JS. But then everything still loaded. In this case the right column is so big, with a lot of content, it seems worthwhile to not load it for the page to load faster.

What should I do?

Peter Westerlund
  • 741
  • 1
  • 10
  • 36
  • 1
    You need to work server-side then, detect the USer Agent and if is mobile don't load that partial view. If you visit Packagist (by the tags you used I guess you've developed in php) there are some good libraries there – Damien Pirsy Jun 05 '14 at 09:13

2 Answers2

1

You should be able to detect the user's browser on the backend (I assume you're using PHP) and then make a simple control structure where you decide whether to load or not load that right-hand column on your site.

Here are some libraries that you may find useful (obviously you shouldn't have to reinvent the wheel for such a trivial task):

silkfire
  • 24,585
  • 15
  • 82
  • 105
  • Aha, now it starts to dawn on me. There it is also written about the RESS concept, I just now learned! The only thing I worry about with device-detection. Must I keep it up to date with the times new devices launches? – Peter Westerlund Jun 05 '14 at 09:34
  • @PeterWesterlund Well you probably won't have to, because it only looks for the manufacturer string (like Samsung, HTC, Apple) and it's not exactly you get a new player on the mobile market every day. But those I linked seem to keep their libraries up to date, so you don't have much to worry about. – silkfire Jun 05 '14 at 10:50
0

If you think that it is not a problem that mobile users wont be able to see that content, then you should not load it. There are php classes to check for mobile devices and based on that you can decide to not load some part of content. There is one problem - php class can only base on user agent settings, not browser size, so in theory someone with high resolution mobile device wont be able to see that content anyway.

One more idea on my mind - you can not load content in php, but after general content is loaded, check in js viewport width and eventually load part of content by ajax if there is enough place.

In summary, as we dont know your site content, it is up to you to decide if you can afford to not show part of content at all (for mobile devices). In this case when resolution change, users still wont be able to see it (i.e. changing device position horizontal to vertical). Of course in this case page will load faster, which also migh be crucial for mobile internet connections.

MSadura
  • 1,032
  • 13
  • 18