Quote

We're also available for Custom Joomla Development

Hire us now

Mini k2 Support for multi categories?

I have Additional categories installed along with mini k2, and I would like to be able to pull items that have multi categories. Currently it just pulls the item if the category is set in the core k2, but not the ones I assign in the additional categories.

How can we make these work together?
Resolved
The discussion has been resolved.

Accepted Answer

     
  • Replied by Bambamsn2009 on Thursday, March 24 2016, 11:14 AM · Hide· #1
    Hi,
    I know this thread is older, but if anyone is interested I got a workaround / solution for this problem I got. too.
    It's a mix of minik2 and additional categories. Just edit modules/mod_minik2/tmpl/portfolio/default.php as follows or copy the whole code. It's my default.php:
    <?php
    /**
     * @version		$Id: default.php 565 2010-09-23 11:48:48Z schro $
     * @package		Mini K2
     * @subpackage	Portfolio with quicksand sorting sub template
     * @author	    TemplatePlazza http://www.templateplazza.com
     * @copyright	Copyright (c) 2007 - 2012 TemplatePlazza, web developement and design marketplace. All rights reserved.
     * @copyright	Copyright (c) 2011 tutorialzine.com
     * @copyright	Copyright (c) 2006 - 2012 JoomlaWorks, a business unit of Nuevvo Webware Ltd. All rights reserved.
     * @license		GNU/GPL license: http://www.gnu.org/copyleft/gpl.html
     */
    
    // no direct access
    defined('_JEXEC') or die('Restricted access');
    ?>
    
    <div id="filter"></div>
    
    <div id="folio-container">
        
        <ul id="stage">
       
        <?php 
        foreach ($items as $key=>$item){
    		$itemID = $item->id;
        ?>  
    	
    	<?php $db = JFactory::getDBO();
    			$query = "SELECT c.`id`,c.`name`,c.`alias` FROM #__k2_additional_categories AS ca, #__k2_categories AS c WHERE ca.`itemID` ='$itemID' AND c.`id`=ca.`catid`";
    			$db->setQuery( $query );
    			$sel_value = $db->loadObjectList();
    		
    		 	echo  '<li data-type="'.$item->categoryname;
    				foreach($sel_value as $v) {   		
    					echo ', '.$v->name;
    				} 
    			echo '" />';
        ?>
                <a href="/<?php echo $item->link; ?>">
                <?php if (!$item->image): ?>
                <img src="/images/header/no-image-th.jpg" alt="<?php echo $item->title; ?>" />
                <?php else: ?>
                    <img src="/<?php echo resizeImageHelper::getResizedImage('/'.$item->image, $tmbWidth, $tmbHeight, $option); ?>" alt="<?php echo $item->title; ?>" style="height:<?php echo $tmbHeight; ?>px; width:<?php echo $tmbWidth; ?>px" />
    				<?php endif; ?>            
                    <div class="description">
                    <h3><?php echo $item->title; ?></h3>
                    
             <p><?php if($params->get('itemIntroText')) { echo $item->introtext; } ?></p>
                    </div>
                </a>
            </li>
        <?php } ?>
        </ul> 
    </div>
        
    <!-- MiniK2 Joomla 3.0 module - Another Quality Freebie from TemplatePlazza.com -->
    
    

    Hope, this helps anyone...

    Matthew.
    • admin - more than a month ago
      Thanks for the workaround!
  •  
  • Replied by fullcream on Friday, February 09 2018, 03:42 AM · Hide· #2
    Sorry I know this is an old topic, I have tried Bambbamsn2009 solution however I get the following message "Please check your setting to get the items or maybe you need to write your K2 items first."

    Have there been changes that have affected this code? hoping someone can help.

    Apologies I cannot add a url or link as I am testing on local.
    • fullcream - one week ago
      Just realized I am using the simple template hence the issue, any ideas to add the above workaround?
  •  
  • Replied by lbrown on Wednesday, December 18 2013, 10:47 PM · Hide· #3
    Hi,

    I have an addon for k2 - https://extensions.joomla.org/extensions/extension-specific/k2-extensions/22204

    It allows me to put k2 items in more than one category. For example, I have a client that would fall under web design and print design categories. So the Additional Categories Addon allows me to do this, but the Mini K2 doesn't recognize the additional categories I've set. So in the module on the Print Page, it's set to show k2 items fro the print category, but it doesn't show it if that's it's second category. It will show in the web design module, since that's it's primary category.

    Does that make sense?
  •  
  •  
    Replied by admin on Wednesday, December 18 2013, 10:27 PM · Hide· #4
    Hi Ibrown, can you tell me what do you mean by additional categories?
    Btw you can change the category setting from the module backend. Please have alook on this : http://d.pr/i/dYNH
    Please post rating at the Joomla! Extensions Directory - http://extensions.joomla.org/profile/profile/details/264
Your Response
Please login first in order for you to submit comments