Created
January 16, 2014 04:57
-
-
Save hissy/8450002 to your computer and use it in GitHub Desktop.
[concrete5] Detect mobile browser and switch mobile block template from default custom template.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php defined('C5_EXECUTE') or die("Access Denied."); | |
Loader::library('3rdparty/mobile_detect'); | |
$md = new Mobile_Detect(); | |
if ($md->isMobile()) { | |
include('mobile.php'); | |
} else { | |
include('default.php'); | |
} |
Author
hissy
commented
Jan 16, 2014
- blocks/block_handle/templates/template_handle/view.php
- blocks/block_handle/templates/template_handle/default.php
- blocks/block_handle/templates/template_handle/mobile.php
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment