Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Split from: http://drupal.org/node/1866196
A context reaction to override ad unit size, coupled with http://drupal.org/project/context_breakpoint, could provide a neat way of delivering ads on reactive themes.
We have a scenario where we have three buttons the same size in a sidebar, so the ability to select more than one ad unit for this would be helpful.
Thoughts?
Comments
Comment #1
bleen CreditAttribution: bleen commentedThis is something i would definitely consider as long as we found a good way to say "at breakpoint X, set tagA's size to wXh AND tagB's size to wXh ...." The UI here could get very confusing
Comment #2
gurrmag CreditAttribution: gurrmag commentedI was thinking breakpoints+context-breakpoint to provide a context condition that effectively looks to see if a media query set in breakpoints is satisfied - see attached.
Comment #3
gurrmag CreditAttribution: gurrmag commentedVery rough mock-up of UI following that of existing context plugin for DFP - not sure if tokens are necessary though?
Comment #4
bleen CreditAttribution: bleen commentedThis patch should work really well (especially with a module like context_breakpoint for example) and should allow users to override the size of ads.
Comment #5
gurrmag CreditAttribution: gurrmag commentedThat's great... Thanks for looking at this so quickly...
I'll look at this as soon as I can...
Comment #6
bleen CreditAttribution: bleen commentedThanks ... the sooner the better - I'm ramping up to do an official release of DFP :)
Comment #7
gurrmag CreditAttribution: gurrmag commentedI can confirm this works... Looking forward to an official release!
In case anyone else decides to go down this path, it may be worth just cross-posting this issue/patch on context_breakpoints which means, on some browsers, the context using breakpoints will not fire the first time someone visits the site (i.e. cleared cookies): Current context is not checked against existing cookie when page is loaded, so, without applying the patch at #1 there, you may get either no ads or ads of the wrong size the first time you visit the site.
Comment #8
bleen CreditAttribution: bleen commentedI'll take that as RTBC :)
Comment #9
bleen CreditAttribution: bleen commentedstupendous ... committed