How to remove mobile layout from Joomla template?

230 views Asked by At

I use non-responsive Joomla template from Gavick. For mobile, I started to use Jtouch. There is a bug in the template, creating duplicate page. Html is:

<div id="gkMainbodyWrap">                                                                       
    <div id="gkComponent">                  
    <gavern:desktop>
    <div class="item-page">
    // here is page code
   </gavern:desktop>

   <gavern:mobile>
   <div class="item-page">
    // ... here is the page content again !!! ...           
   </gavern:mobile>

I am trying to find what to delete from the template php file, to stop this duplication.

Here is the relevant part of the php:

<div id="gkMainbody" class="gkMain">
    <div id="gkMainbodyWrap">
        <?php if($this->isFrontpage()) : ?>
            <?php if($this->getParam('mainbody_frontpage', 'only_component') == 'only_component') : ?>  
            <div id="gkComponent">
                <jdoc:include type="component" />
            </div>
            <?php elseif($this->getParam('mainbody_frontpage', 'only_component') == 'mainbody_before_component') : ?>
            <div id="gkComponent">
                <jdoc:include type="component" />
            </div>
            <?php else : ?>
            <div id="gkComponent">
                <jdoc:include type="component" />
            </div>
            <?php endif; ?>
        <?php else : ?>
            <?php if($this->getParam('mainbody_subpage', 'only_component') == 'only_component') : ?>    
            <div id="gkComponent">
                <jdoc:include type="component" />
            </div>
            <?php elseif($this->getParam('mainbody_subpage', 'only_component') == 'mainbody_before_component') : ?>
            <div id="gkComponent">
                <jdoc:include type="component" />
            </div>
            <?php else : ?>
            <div id="gkComponent">
                <jdoc:include type="component" />
            </div>
            <?php endif; ?>                 
        <?php endif; ?>
    </div>
</div>

Maybe I am an Idiot, but all this if-else seems to be doing the same.

Any help of how to remove the code creating duplication will be very much appreciated,

Help a dime in distress :)

1

There are 1 answers

1
Craig On
  1. You're not an idiot, as for the person that wrote that if well… that's another story.

  2. Let me re-write that gkMainbodyWrap for you:

hmmm

<div id="gkMainbody" class="gkMain">
    <div id="gkMainbodyWrap">
        <div id="gkComponent">
            <jdoc:include type="component" />
        </div>
    </div>
</div>
  1. The <gavern:mobile> and <gavern:desktop> tags are probably intended to be processed by their template framework/code base and are probably meant to act as a switching mechanism of some sort, like a basic type of progressive enhancement (aka Adaptive web design). So, possibly JTouch is interfering with the Gavick code.

  2. Last I looked JTouch was a mobile adaptive/reactive solution not a responsive one, and those gavern tags look like an attempt at adaptive block markers, is it possible that the template while not responsive is actually adaptive?