Archive

What are the best tools for accurate Cross-Browser Testing?

May 4th, 2012


One would almost certainly be forgiven for thinking that given the vast array of tools that web developers have at their disposal, there would be one single tool that would allow you to accurately test for all browsers.

Unfortunately this is not the case.

Modern browsers are being updated regularly, which increasingly makes for a more seamless testing experience.  But at the time of writing, us developers and designers still have to cross swords with Internet Explorer and its older versions.  Support for IE6 was dropped at the turn of the year and our main battle now lies with IE7.  Although The Internet Explorer 7 Countdown currently reports that worldwide usage is now around the 4% mark, although different regions report higher figures than others which requires us to support IE7 for just that little bit longer, fingers crossed.

There are numerous tools that are available to test IE7 from simulators and web based solutions through to legacy versions and here I’m going to run through what I’ve used in the past and what I’m currently using now to get the best possible results.
Read

Dansmart.co.uk mobile theme

May 5th, 2010


When viewed by a mobile device, this site will be displayed with the dansmart.co.uk mobile theme, rather than the desktop theme. This has been made possible by the Mobile Smart WordPress plugin which is under development, and available in the WordPress plugin repository.

The theme will undergo further development over the coming weeks, in concert with the development of the Mobile Smart plugin default theme, and the Mobile Smart content transformation functions (allowing automatic scaling of image content to fit the device viewing the site).

<h3 class=”standout-header”>Mobile Smart Plugin for WordPress v0.2</h3>
<p>With Mobile Smart you can have a selection of tools to enable your theme to work better with mobile devices. Download it from the WordPress Plugin Repository: <a href=”http://www.wordpress.org/extend/plugins/mobile-smart”>http://www.wordpress.org/extend/plugins/mobile-smart</a></p>
<br/>
<h3>Comments/Support</h3>
Add your comments / support requests to:
<ul>
<li>Comment on the <a href=”http://www.dansmart.co.uk/2010/03/released-mobile-smart-plugin-for-wordpress-v0-2/”>Release post</a></li>
<li>Contact me via the <a href=”http://www.dansmart.co.uk/contact/”>Contact form</a></li>
</ul>
<br/>
<br/>
<h3>Description</h3>
Mobile Smart currently contains the following functionality:
<ul>
<li>Switch your theme to a mobile-ready theme if a mobile device is detected</li>
<li><strong>New: </strong>Manual Switcher – to allow your user to manually switch between desktop and mobile versions. Available in 3 versions: widget, option to automatically insert into footer, or template tag.</li>
<li>Template functions to help determine which tier of mobile device (touch/smartphone/other) is viewing your site, to allow conditional content inclusion.</li>
<li>Adds device and tier specific CSS selectors to the body_class, to allow conditional CSS (e.g. so in the same way you have “.single” that you can target “.iphone” or “.mobile-tier-touch”.)</li>
</ul>
<p>See the Frequently Asked Questions for guidance on how to use the plugin.</p>

<p>Note: More functionality will be coming over the coming weeks. <br>
On the Roadmap:</p>
<ul>
<li> Mobile theme – to get you going without needing a theme designer.</li>
<li>Admin – user added Mobile Devices</li>
<li>Mobile Device Log – for you to track which devices are using your website</li>
</ul>
<br/><br/>
<h3>Installation</h3>
This section describes how to install the plugin and get it working.
<ol>
<li> Upload the `mobile-smart` directory to the `/wp-content/plugins/` directory</li>
<li>Activate the plugin through the ‘Plugins’ menu in WordPress</li>
<li>Go to Settings-&gt;Mobile Smart and choose your theme to display when a mobile device encounters your page.</li>
</ol>
<p>See the Frequently Asked Questions for guidance on how to use the plugin.</p>
<br/>
<h3>Frequently Asked Questions</h3>
<strong>= Does the Mobile Smart plugin work with other mobile plugins =</strong>

It would be advisable not to use other mobile theme switching functionality with this unless theme switching is turned off (go to Settings-&gt;Mobile Smart to disable).

This has been tested with the WordPress Mobile Pack transcoder and is noted to be compatible, though the list of mobile devices are different between the two.

<strong>= Does the Mobile Smart plugin do domain switching =</strong>

Not currently, though that is on the roadmap.

<strong>= How do I enable unique handset body classes =</strong>

To enable the CSS body classes, ensure that in your mobile theme you have the body_class() function included:
<pre lang=”php”>
<body class=”<?php body_class(); ?>”>
</pre>
<strong>= How do I change stylesheets dependent on device tier =</strong>

How do I use the body classes?

If you have a style that you only want a specific tier of device (e.g. touch handsets like the iPhone) to use, then use the body class CSS selector in your CSS file as follows:

Example:
<pre lang=”css”>/* for all links */
a {
color: black;
}
/* increase padding on anchors on touch handsets to allow for big fingers
.mobile-tier-touch li a {
padding: 20px;
}</pre>
= How do I change stylesheets dependent on device tier =

You would do this if you prefer to split out each device tier CSS into separate files. Be aware that this creates an extra function call though.

Use the following PHP code:

<pre lang=”php”>
<?php
/* add additional stylesheet for certain mobile types */
global $mobile_smart;
// add stylesheets dependent on header
if ($mobile_smart->isTierTouch() == MOBILE_DEVICE_TIER_TOUCH)
{
wp_enqueue_style(‘mobile-touch’, get_bloginfo(‘stylesheet_directory’).”/css/touch.css”);
}
else if ($mobile_smart->isTierSmartphone())
{
wp_enqueue_style(‘mobile-smartphone’, get_bloginfo(‘stylesheet_directory’).”/css/smartphone.css”);
}
?>
</pre>

Note: these functions do not test for the Manual Switcher. To test for the manual switcher (in case you are using
these template tag functions in a desktop theme), you should call:

<pre lang=”php”>
<?php
/* add additional stylesheet for certain mobile types */
global $mobile_smart;
// find out manual switching state
$is_manual_switched_to_mobile = $mobile_smart->switcher_isMobile();
?>
</pre>

<strong>= Can you add xxxx-device to the <strong>the Mobile Smart plugin </strong>? =</strong>

Please email me with details of the device that is not yet supported by Mobile Smart, and I will add it in, and endeavour to release an updated version within the week (if timescales allow).
<h4>= How do I use the Manual Switcher? =</h4>
You have the option of the following:
<ul>
<li>Mobile Smart Manual Switcher Widget – go to Appearance-&gt;Widgets and drop the widget in an appropriate sidebar. If you’re a theme developer, you can create a new ‘sidebar’ in the appropriate location, e.g. the footer bar, if you don’t want this option in the standard sidebar.</li>
<li>Enable Manual Switcher in footer – if this option is enabled (via the Options-&gt;Mobile Smart page), this adds the Manual Switcher link into the wp_footer() call, which means it will be displayed at the bottom of your page.</li>
<li>Template tag, see below:</li>
</ul>
<pre lang=”php”>
<?php
// get global instance of Mobile Smart class
global $mobile_smart;

// display manual switcher link – requires Manual Switching to be enabled
$mobile_smart-&gt;addSwitcherLink();
?>
</pre>
The Manual Switcher displays the switcher link in a div with an id of *mobilesmart_switcher*

<strong>= Where can I get a mobile theme from? =</strong>

Try the WordPress Mobile Pack for a good example of a theme that is compatible with XHTML-MP.

<strong>= What’s on the roadmap? =</strong>
<ul>
<li>Admin interface to allow adding of user agents</li>
<li>Domain switching of themes</li>
<li>PHP and Javascript helper functions</li>
</ul>


Switch to mobile version