Posting in the Magento forums has been disabled pending the implementation of a new and improved forum solution which should better serve the community.

For new questions please post at magento.stackexchange.com, the community-run support site for the Magento community. We will be providing updates on the new forum solution soon. For questions or concerns please email community@magento.com.

Magento Forum

How do I modify layered navigation
 
muffinnn21
Jr. Member
 
Total Posts:  5
Joined:  2008-06-17
 

Hello,

What i’m trying to do is to put more then 1 choice per line. I would like to change the ordered list to something like a paragraph that auto break line each time the width of the block allowed is reached.

Let’s say you currently have

Color
Blue(22)
Red(18)
Green(14)
Etc

I would like it to be
Color
Blue(22), Red(18), Green(14),
Etc, ... , ...

In this case multiple selection would be usefull since some items that have blue can also have red or green spots. If I use the following post : http://www.magentocommerce.com/boards/viewthread/5500/P0/

What I would come up with would be something like :

if(!function_exists("_displayOrderedlist")){
        
function _displayOrderedlist($atts,$displayitemcount){
            
echo '<ol>';
            foreach(
$atts->getItems() as $_item){
                
echo '<li><a href="'.$_item->getUrl().'">'.$_item->getLabel().'</a>';
                if(
$displayitemcount){
                    
echo ' ('.$_item->getCount().')';
                
}
                
echo '</li>';
            
}
            
echo '</ol>';
        
}
    }
  
if(!function_exists("_displayInline")){
        
function _displayInline($atts,$displayitemcount){
            
echo '<p>';
            foreach(
$atts->getItems() as $_item){
                
echo '<a href="'.$_item->getUrl().'">'.$_item->getLabel().'</a>';
                if(
$displayitemcount){
                    
echo ' ('.$_item->getCount().')';
                
}
                
echo ", ";
            
}
            
echo '</p>';
        
}
    }

 
switch ($attributeName{
        
case 'GemColor':
        case 
'Overthreshold':
            
_displayInline($this,$displayitemcount);
            break;
    
        default:
            
_displayOrderedlist($this,$displayitemcount);
            break;
    
}

I’m far from a coder and some help would be appreciated to make this block of code work!

thank you

 
Magento Community Magento Community
Magento Community
Magento Community
 
muffinnn21
Jr. Member
 
Total Posts:  5
Joined:  2008-06-17
 

well it seem that my modification pretty much work for what I wanted to do smile

 
Magento Community Magento Community
Magento Community
Magento Community
 
burt
Member
 
Total Posts:  31
Joined:  2008-08-26
 

I guess this could also have been done with a simple css-modification ( .theClass li { diplay: inline; } )

 
Magento Community Magento Community
Magento Community
Magento Community
Magento Community
Magento Community
Back to top