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?