Mobile K2 content

Business template for Joomla 3 and 2.5 ideal to create blog or personal website.
GK User
Thu Apr 19, 2012 10:23 pm
Hi,

I'm currently working on a updating my old J1.0 site to J2.5. I'm using K2 for all my content but this gives issues on the mobile version. The mobile version uses 4 Joomla featured items and not K2 items. How would I go about setting the mobile site up to use x latest K2 items on the frontpage collapsable.

When viewing K2 content it's displayed like a normal browser and not altered to be viewed on a mobile device. For intance, the colored date block on the left used up a lot of space, I'ld rather disable that on the mobile version. Where would I have to change that for only mobile viewers.

http://j25.xiphias.net is the dev location of the new site.

Thanks,



Michael
User avatar
Junior Boarder

GK User
Fri Apr 20, 2012 12:19 am
Did a sitewide search and is it correct that the mobileParser() function in the lib/gk.framework.php has to be altered to convert K2 articles to collapsible content?

Any help on that would be very welcome.

-XiP
User avatar
Junior Boarder

GK User
Fri Apr 20, 2012 2:50 am
Well, I'm getting a few stops closer. Doing Google Search got me to the Gavern Framework where I checked out the documentation.

I have my home in the menu setup to show K2 latest items. Home still shows Joomla featured items.

I copied com_k2/templates/default to a custom one.
In the custom latest.php I added <gavern:desktop> right below the direct access code and </gavern:desktop> at the bottom.
Below that I added the mobile code:
Code: Select all
<gavern:mobile>
<!-- Start K2 Latest Mobile Layout -->
  <div id="k2Container" class="latestView<?php if($this->params->get('pageclass_sfx')) echo ' '.$this->params->get('pageclass_sfx'); ?>">
    <div class="latestItemsUser">
      <div class="items-leading">
        <?php foreach($this->blocks as $key=>$block): ?>
          <?php if($this->params->get('latestItemsDisplayEffect')=="first"): ?>
            <?php foreach ($block->items as $itemCounter=>$item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
<!-- loop 1 -->
                     <?php if($itemCounter==0): ?>
                <?php $this->item=$item; echo $this->loadTemplate('item'); ?>
              <?php else: ?>
                <h2 class="latestItemTitleList">
                  <?php if ($item->params->get('latestItemTitleLinked')): ?>
                    <a href="<?php echo $item->link; ?>"> <?php echo $item->title; ?> </a>
                  <?php else: ?>
                    <?php echo $item->title; ?>
                  <?php endif; ?>
                </h2>
              <?php endif; ?>
            <?php endforeach; ?>
               <?php else: ?>
                  <?php foreach ($block->items as $item): K2HelperUtilities::setDefaultImage($item, 'latest', $this->params); ?>
<!-- loop 2 -->
                     <?php $this->item=$item; echo $this->loadTemplate('item'); ?>
            <?php endforeach; ?>
          <?php endif; ?>
        <?php endforeach; ?>
      </div>
    </div>
  </div>
<!-- End K2 Latest Mobile Layout -->
</gavern:mobile>


Even while doing so I still get the desktop version and when I view source the </gavern:desktop> is shown in the code. Could this be a framework problem? When I just put the mobile code in the latest.php it's 95% what I want with some minor styling issues but the desktop version cant be used.

Code: Select all
  </div>
<!-- End K2 Item Desktop Layout -->
  </gavern:desktop>
 
 
   
<!-- Start K2 Item Mobile Layout -->
    <div class="items-row">


Below are some screenshots.
Left is the home page with the Joomla Items.
Center is the home via menu which are the latest K2 items with some CSS fixing to do, this is the latest.php with only the mobile code.
As soon as I add the original desktop code to latest.php you get the right screenshot.

debugging_XiPHiAS-680.jpg


Any help is welcome and will mobile K2 support be added by default in the near future?
User avatar
Junior Boarder


cron