tag:support.baseworks.nl,2011-05-09:/discussions/mobile/10-media-queriesBaseworks: Discussion 2011-11-15T21:09:49Ztag:support.baseworks.nl,2011-05-09:Comment/113648082011-11-12T20:06:53Z2011-11-12T20:06:53ZMedia Queries<div><p>Hi Greg,</p>
<p>If using mediaqueries in PHP were possible I would've certainly
used them, but helas they are not. The only way to fetch the screen
size on the back-end would be to use javascript to send a request
to a script with the sizes and act from there. But that wouldn't be
foolproof either.</p>
<p>– Wouter</p></div>Wouter Vervloettag:support.baseworks.nl,2011-05-09:Comment/113648082011-11-12T20:19:30Z2011-11-12T20:19:30ZMedia Queries<div><p>well pooh</p>
<p>Thanks for the fast reply though.</p>
<p>GF</p>
<hr>
<p>Alaska Web Crafters</p>
<p>Over 15 years of web design experience<br>
Serving small to medium sized Alaskan businesses</p>
<p>web: <a href=
"http://www.alaskawebcrafters.com">www.alaskawebcrafters.com</a></p>
<p>ph: 907.554.1088</p>
<p>Greg Fensterman<br>
Alaska Web Crafters<br>
Box MXY, <a href="/discussions/mobile/46" title=
"Discussion #46">#46</a>B<br>
Glennallen, AK 99588</p></div>Gregory Fenstermantag:support.baseworks.nl,2011-05-09:Comment/113648082011-11-14T23:15:03Z2011-11-14T23:15:03ZMedia Queries<div><p>So what will knowing the user agent tell me? (don't really know
much about those)</p>
<p>It's possible to use a single template for everything from
desktop to phone, but then you end up hiding some of the content.
The client doesn't have to download the unneeded content but they
still have to download the markup.</p>
<p>So I would like to be able to send anything smaller than an iPad
to an alternate template set. Can I do that with your addon?</p>
<p>That way I would be sending less markup that doesn't get
displayed. Also I can specify a different image size as the base
size.</p>
<p>What exactly does User Agent tell me?</p>
<p>Thanks</p>
<p>Greg</p>
<hr>
<p>Alaska Web Crafters</p>
<p>Over 15 years of web design experience<br>
Serving small to medium sized Alaskan businesses</p>
<p>web: <a href=
"http://www.alaskawebcrafters.com">www.alaskawebcrafters.com</a></p>
<p>ph: 907.554.1088</p>
<p>Greg Fensterman<br>
Alaska Web Crafters<br>
Box MXY, <a href="/discussions/mobile/46" title=
"Discussion #46">#46</a>B<br>
Glennallen, AK 99588</p></div>Gregory Fenstermantag:support.baseworks.nl,2011-05-09:Comment/113648082011-11-14T23:31:35Z2011-11-14T23:33:44ZMedia Queries<div><p>Hi Greg,</p>
<p>Basically, the User Agent string tells you which
browser/device/OS the visitor is using to access your site. For
example, this is the one used by my version of Chrome:</p>
<p><code>Mozilla/5.0 (Macintosh; Intel Mac OS X 10_7_2)
AppleWebKit/535.7 (KHTML, like Gecko) Chrome/16.0.912.36
Safari/535.7</code></p>
<p>and the iPhone UA looks something like this:</p>
<p><code>Mozilla/5.0 (iPhone; U; CPU iPhone OS 3_1_2 like Mac OS X;
en-us) AppleWebKit/528.18 (KHTML, like Gecko) Version/4.0
Mobile/7D11 Safari/528.16</code></p>
<p>I have to manually maintain these UA's to keep up with new
devices, but I do so once in a while... If you're interested,
<a href="http://www.zytrax.com/tech/web/mobile_ids.html">this</a>
is where I get my information about the mobile UA's.</p>
<p>You can basically send anything but the iPad to a mobile
template by clearing the iPad setting in the extension settings. In
those mobile-specific templates you can display images specific for
mobile, but there are any images in your content (channel entries)
it's going to a bit more difficult.</p>
<p>There are several way to serve up images optimized for mobile,
but they either involve javascript or some custom server
configuration, neither are built into Mobile though.</p>
<p>Hope this cleared things up a bit.</p>
<p>– Wouter</p></div>Wouter Vervloet