Topic: Use two designs for mobile and for normal web idea

Use two designs  one for mobile and other for normal web

If you like try here width your mobile

Files needed:


For mobile:

  • header chunk  example mobheader.chunk.php

  • footer   chunk  example mobfooter.chunk.php

Optional for a beauty code


For normal web:

  • header.chunk.php

  • footer.chunk.php

And in index.template.php write this code:


 // load header chunk
<?php 
    if (Agent::isMobile()) {
        // if is mobile load this header
        Chunk::get('mobheader');
    }else{
        // if not a mobile load this
        Chunk::get('header');
    } 
?>
// load content
<?php if (Agent::isMobile()) { ?>
         // if is mobile load this content
        //  your mobile content
        <?php echo Site::content(); ?>  
<?php }else{ ?>
        // if not  is mobile load this content 
        // your normal web content 
        <?php echo Site::content(); ?>  
<?php } ?>        
// load footer chunk
<?php 
    if (Agent::isMobile()) {
       // if is mobile load this footer
       Chunk::get('mobfooter');
    }else{
      // if is not a mobile load this footer
       Chunk::get('footer');
    } 
?>

Sorry for my English

..::: Moncho Varela ::::..   ..::: @Nakome ::::..   ..::: Github ::::..

nakome's Website