yes, but there is already browser sniff class included in modx, use $modx->getUserData(), it returns browser info in an array..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."
how would that work with what i’m attempting to do, want to have a conditional banner for IE users that displays a download firefox banner above the template, should this be a snippet ?
how to use $modx->getUserData() for this
do a snippet that does:
print_r($modx->getUserData());
Then go to the document that runs this and view the source to see what’s in that array. For the browser type, you can use:
if($modx->getUserData()[’browser’] == ’ie’) {
return $modx->getChunk(’somechunk’);
}
and do a chunk by the name somechunk and put your banner html in it.. to make the snippet better, make it read some snippet parameter to get the chunk name etc..
"He can have a lollipop any time he wants to. That's what it means to be a programmer."