Posted by Random Domains on July 30, 2012 at 8:10pm
I'm looking to use drupal for a website that serves content for both pc, tablet and smartphone (thanks to adaptivethemes). The main issue I have is when dealing with block content that will be too large for the smartphone to display. An easy solution to the problem is to only display certain blocks if the screen width exceeds a defined size (and to display a different block if the screen width is less than the defined size). I'm still a bit new to php coding and would appreciate any help I can get.
The logic would be as follows:
<?php
if (condition)
{ return TRUE; // block will be shown
} return FALSE;
?>With (condition) being a logical test:
"does the screen size exceed a defined px number?"
Thanks in advance for any help that might be forthcoming.
Comments
_
See #1315686: limit block by media query.
_
Don't be a Help Vampire - read and abide the forum guidelines.
If you find my assistance useful, please pay it forward to your fellow drupalers.
Thanks for the reply. I'd
Thanks for the reply. I'd seen this before, but I need a bit more flexibility that just removing blocks for "mobile".
I'm playing with a few options and will post the final code when I've worked it out.
Random Domains