Why is there no 'responsive' variable/switch in XF 1.2?

No, here's the headers sent via Chrome when I've sized down the site to a mobile view in the browser:
Accept:text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
Accept-Encoding:gzip,deflate,sdch
Accept-Language:en-US,en;q=0.8
Cache-Control:max-age=0
Connection:keep-alive
Cookie:[x]
Host:xenforo.com
If-Modified-Since:Tue, 25 Jun 2013 22:09:51 GMT
Referer:http://xenforo.com/community/
User-Agent:Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_2) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/27.0.1453.116 Safari/537.36

There is no way for a server to reliably determine if its going to be mobile-sized.
 
So Adsense wins, use it. And if your provider wants to compete with Google it should offer these must-have features. As for now the solution they gave you just shows how much they care about their clients.

No, I'll disable responsive. A feature that forces me to change advertisers because they don't offer the 'right' code isn't really useful, sorry.
 
You can't really blame XF or "the responsive feature" because the ad server you use isn't willing to move with the times.

There is nothing XF can do to resolve this - it is up to ad servers to provide solutions where media queries don't work.
 
No, I'll disable responsive. A feature that forces me to change advertisers because they don't offer the 'right' code isn't really useful, sorry.

It's not a forum software problem. Technologies have gone far and it's not a forward-looking attempt to just ignore them. XF provides backward compatibility for cases like this, so if it's critical for you just say 'no' to the new awesome features.
 
As it stands - with no server-side control - I will simply have to disable responsive as it will not fit in with the banner sizes I use and I am not willing to sacrifice revenue for the sake of the responsive "feature".

What you're looking for is RESS - responsive web design with server side components. Often it's done with libraries like Modernizer (for feature detection) and WURFL (for device detection). It's rather complex and not foolproof. Some interesting articles:

http://www.lukew.com/ff/entry.asp?1392

http://dmolsen.com/2012/02/21/ress-and-the-evolution-of-responsive-web-design/

http://www.slideshare.net/yiibu/adaptation-why-responsive-design-actually-begins-on-the-server/

http://mobile.smashingmagazine.com/...-with-server-side-enhanced-responsive-design/

http://www.netmagazine.com/tutorials/getting-started-ress

http://ress.io/
 
It's not a forum software problem. Technologies have gone far and it's not a forward-looking attempt to just ignore them. XF provides backward compatibility for cases like this, so if it's critical for you just say 'no' to the new awesome features.

That's what I'll have to do. After discussing it here it's clear there is nothing I can do to control the layout when in responsive mode (well, nothing within my limited programming capabilities ;)), so until my ad networks catch up with XF it's a useless feature because it will lose me revenue and/or trash my layout!!

My choices appear to be:
  • Embrace responsive and drop all other ad networks except Adsense
  • Load small ads for all placements so they always fit a small viewport width
  • Learn PHP and javascript and program my way out of the predicament
  • Turn off responsive and carry on regardless
It's just going to have to be number four to start with - I'm sure we'll work something out in the longer term - I've worked too hard for too long to simply take a pay cut to use responsive, however awesome it may be. (y)

Thanks for your replies - I do appreciate them.

Cheers,
Shaun :D
 
That's what I'll have to do. After discussing it here it's clear there is nothing I can do to control the layout when in responsive mode (well, nothing within my limited programming capabilities ;)), so until my ad networks catch up with XF it's a useless feature because it will lose me revenue and/or trash my layout!!

My choices appear to be:
  • Embrace responsive and drop all other ad networks except Adsense
  • Load small ads for all placements so they always fit a small viewport width
  • Learn PHP and javascript and program my way out of the predicament
  • Turn off responsive and carry on regardless
It's just going to have to be number four to start with - I'm sure we'll work something out in the longer term - I've worked too hard for too long to simply take a pay cut to use responsive, however awesome it may be. (y)

Thanks for your replies - I do appreciate them.

Cheers,
Shaun :D

Hopefully you get this sorted Shaun I noticed you've worked hard on your site. Useless post i'm making but more to say I hope you get this all rectified sooner rather than later. :)
 
What you're looking for is RESS - responsive web design with server side components. Often it's done with libraries like Modernizer (for feature detection) and WURFL (for device detection). It's rather complex and not foolproof. Some interesting articles:

http://www.lukew.com/ff/entry.asp?1392

http://dmolsen.com/2012/02/21/ress-and-the-evolution-of-responsive-web-design/

http://www.slideshare.net/yiibu/adaptation-why-responsive-design-actually-begins-on-the-server/

http://mobile.smashingmagazine.com/...-with-server-side-enhanced-responsive-design/

http://www.netmagazine.com/tutorials/getting-started-ress

http://ress.io/

After speed-reading through a couple of those I have nothing but sympathy for developers ... :D
 
Hopefully you get this sorted Shaun I noticed you've worked hard on your site. Useless post i'm making but more to say I hope you get this all rectified sooner rather than later. :)

Thanks Shelley - I'm trying to figure out an approach before upgrading; obviously I'm as passionate about XF as the next person and want all the goodies of 1.2 too, but I also need to protect what I've worked for and, most importantly, my revenue.

I've learned, from people's replies, how it works and what can / cannot be done so now I understand it better I'll mull it over, consider my options, and work something out. :D

Cheers,
Shaun :D
 
Not really. The viewport size can change after serving too (which is what responsive design does).

I appreciate that, and realise it's an all-or-nothing approach; you either do it server-side and accept the limitations of not being able to detect every "mobile" device and "code" mobile separately, or do it as the XF guys have chosen to and adapt the layout to suit (and I do appreciate the beauty of it - I'm just frustrated by the lack of server-side control ;)).

I'm sure other, more clued-up, people will find elegant ways of dealing with this and (hopefully) publish how they do it. (y)

Cheers,
Shaun :D
 
I have 2 ad networks as well. Adsense and tribal fusion. I hope I can find a solution for my 2nd ad network to work responsively.
 
That's what I'll have to do. After discussing it here it's clear there is nothing I can do to control the layout when in responsive mode (well, nothing within my limited programming capabilities ;)), so until my ad networks catch up with XF it's a useless feature because it will lose me revenue and/or trash my layout!!

My choices appear to be:
  • Embrace responsive and drop all other ad networks except Adsense
  • Load small ads for all placements so they always fit a small viewport width
  • Learn PHP and javascript and program my way out of the predicament
  • Turn off responsive and carry on regardless
It's just going to have to be number four to start with - I'm sure we'll work something out in the longer term - I've worked too hard for too long to simply take a pay cut to use responsive, however awesome it may be. (y)

Thanks for your replies - I do appreciate them.

Cheers,
Shaun :D

Dosn't BuySellAds offer integration with DfP directly, thats why I'm using it so that I can switch to BSA quickly from adsense without having to swap out all the code.
 
This can be partially fixed with a bit help of JS.
So we need a js to add a class to html element when the page is loaded indicating what layout was used after complete page load. After that this class never changes, even when the layout is changed.
Then if you're not using iframe or JS-generated ads you can play with this configuration:

html:

Code:
<div class="responsive-pics">
<div class="for-desktop">
<a href=""><img src="path/to/image.png" /></a>
</div>
<div class="for-tablet">
<a href=""><img src="path/to/image-tablet.png" /></a>
</div>
<div class="for-mobile">
<a href=""><img src="path/to/image-mobile.png" /></a>
</div>
</div>

css:

Code:
.responsive-pics .for-desktop,
.responsive-pics .for-tablet,
.responsive-pics .for-mobile
{
  display: none;
}

.loaded-desktop .responsive-pics .for-desktop,
.loaded-tablet .responsive-pics .for-tablet,
.loaded-mobile .responsive-pics .for-mobile
{
  display: block;
}

.loaded-*device* should be in html element respectively.

That way images that are not expected to appear in inappropriate layouts will never be loaded. It's important to have a div with display: none; as a parent of img element, otherwise there will be an HTTP request.


As for JS — we need a bit of help from our JS gurus.
 
Dosn't BuySellAds offer integration with DfP directly, thats why I'm using it so that I can switch to BSA quickly from adsense without having to swap out all the code.

They do, buy I don't use DfP anymore and IIRC you still have to use the BSA ad code anyway - it just links to your DfP slot for backfill (and Adsense from DfP if you link them too). (y)
 
This can be partially fixed with a bit help of JS....
That way images that are not expected to appear in inappropriate layouts will never be loaded. It's important to have a div with display: none; as a parent of img element, otherwise there will be an HTTP request.

It's at least against Adsense TOS to embed Adsense code within a display: none block. Well, technically, what's important is that you must not load the ads and then do not display them to the visitors, hence mucking up view/click through stats. If you don't load the ad in the first place, as you suggested, then display: none is probably OK.

https://support.google.com/adsense/answer/1354736?hl=en-GB

https://www.google.com/adsense/terms

http://exisweb.net/how-to-use-google-adsense-on-a-responsive-website
 
Last edited:
It might sound bootleg to some people...but you can use JS/jQ to literally rewrite any part of any page that is rendered in a users browser as well as add and remove things all together. You could load an ad place holder and write in the appropriate sized ad and when it needs to , drop the block with the ad in it and use js/jQ to rebuild that block based on the browser width. I also don't know what the rules are for all the different ad networks as far as customizing the look of the ad.

Problem is I don't run any ads so I have nothing to work with to put something together for you that I could actually test.
 
I've thought some more about this and have come up with a different approach - but one I need help with as I'm not sure how to do it; hide the style chooser from guests! (y)

I only display ads to guests so would like to disable responsive in the default style and not allow guests to change it. This way I can carry on serving ads the same way I do now - from any network.

However, I don't display ads to registered members so I can enable responsive for them in a child style (and tell them how to select it) and it won't impact on revenue and will allow them to enjoy the benefits of the responsive layout.

It'll do as a get-me-by until the ad networks catch up and offer responsive ad-code. (y)

So ... would this be possible, and if so, how would I do it?

Thanks,
Shaun :D
 
Top Bottom