Okay, sorted the question that was here. Probably a solution that could poimt to a different stylesheet, but also change a name of a div or an image etc.
Here s the snippet, I called it prefixSwapper
<?php
/* Snippet Title: prefixSwapper, code adapted from Bobyray code */
$output = '';
/* array of browser agent names and their respective div prefixes */
$prefixArray = array(
'iPhone' => 'i_',
'SymbianOS/9.1' => 'i_',
);
/* see if we recognize one */
foreach ($prefixArray as $key => $value) {
if (strpos($_SERVER['HTTP_USER_AGENT'],$key)) {
$output .= $value;
break;
}
}
/* if we didn't find one, use the standard DIV name */
if ($output == '') {
$output = '' ;
}
return $output;
?>
As you can see, the output of this snippet will be "i_" if it detects an Iphone or a Symbian device. If none, it will be empty! Off course you could create more rules with different prefixes for different devices.
Create a TV, I called it prefix, assign it to your default template.
In default value type:
Use it like so <div id="[*prefix*]wrapper"> or [*prefix*]style.css or maybe [*prefix*]image.jpg
Your CSS file, eg "style.css" would become "i_style.css" or i_image.jpg.
Your "wrapper" div would become "i_wrapper".
Probably not the best solution, but maybe a start for a "real" snippet?