How do I display a dropdown list in the Magento left sidebar?
-
I tried to add several dropdown lists on the left sidebar on the site, they are all have similar settings in the "Catalog"->"Manage Attribute". I used Amasty for this site. However, the odd thing is that one attribute: "School Name" does not display the same as the other three. All the other attributes (Brand, Size, Color) are fine. Here is the screenshots: Settings for the "School Name": How the attributes display on my site: Is there something I've missed? How should I make the "School Name" display as dropdown as the others?
-
Answer:
I figured this out. Solution 1:http://stackoverflow.com/questions/23635223/magento-dropdown-in-the-left-sidebar-display-incorrectly If this doen't work: Solution 2: (this is not ideal but work in my case as I have no label type, I set the label type from 1 to -1, and added a default): <ol <?php if ($this->getCollapsed() && !$this->getHasSelection()): ?>style="display:none" <?php endif ?>><?phpswitch ($this->getDisplayType()){ case -1: // labels only foreach ($this->getItemsAsArray() as $item){ echo '<li '.$item['style'].'><a class="'.$item['css'].'" href="'.$item['url'].'">'. $item['label'] . '</a>' . $item['count'] . '</li>'; } break; case 1: // images only echo '<li>'; foreach ($this->getItemsAsArray() as $item){ echo '<a '.$item['style'].' class="'.$item['css'].'" href="'.$item['url'].'"><img src="'.$item['image'].'" title="'. $item['label'] .'" alt="'. $item['label'] .'"></a>'; } echo '</li>'; break; case 2: // images and labels foreach ($this->getItemsAsArray() as $item){ echo '<li '.$item['style'].'><a class="'.$item['css'].'" href="'.$item['url'].'">'; if (!empty($item['image'])){ echo '<img src="'.$item['image'].'" title="'. $item['label'] .'" alt="'. $item['label'] .'">'; } echo $item['label'] . '</a>' . $item['count'] . '</li>'; } break; case 3: // dropdown echo '<li><select onchange="if (this.value) setLocation(this.value)" class="amshopby-select amshopby-ajax-select">'; //echo '<option value="">' . $this->getName() . '</option>'; echo '<option value="'.$this->getRemoveUrl().'"></option>'; foreach ($this->getItemsAsArray() as $item){ echo '<option '.$item['css'].' value="'.$item['url'].'">'. $item['label'] . $item['count'] . '</option>'; } echo '</select></li>'; break; case 4: // 2 columns $items = $this->getItemsAsArray(); $size = sizeof($items); $half = ceil($size/2); echo '<li>'; echo '<div class="amshopby-column">'; for ($i=0; $i<$half; $i++){ $item = $items[$i]; echo '<a class="'.$item['css'].'" href="'.$item['url'].'">'. $item['label'] . '</a>' . $item['count'] . '<br/>'; } echo '</div>'; echo '<div class="amshopby-column">'; for ($i=$half; $i<$size; $i++){ $item = $items[$i]; echo '<a class="'.$item['css'].'" href="'.$item['url'].'">'. $item['label'] . '</a>' . $item['count']. '<br/>'; } echo '</div>'; echo '</li>'; break; default: echo '<li><select onchange="if (this.value) setLocation(this.value)" class="amshopby-select amshopby-ajax-select">'; //echo '<option value="">' . $this->getName() . '</option>'; echo '<option value="'.$this->getRemoveUrl().'"></option>'; foreach ($this->getItemsAsArray() as $item){ echo '<option '.$item['css'].' value="'.$item['url'].'">'. $item['label'] . $item['count'] . '</option>'; } echo '</select></li>';}if ($this->getDisplayType() < 3 && $this->getShowLessMore()){ echo '<li class="amshopby-clearer"><a id="amshopby-more-'.$this->getRequestValue().'" class="amshopby-more" href="#">' . $this->__('More ...') . '</a></li>'; echo '<li class="amshopby-clearer"><a id="amshopby-less-'.$this->getRequestValue().'" class="amshopby-less" href="#" style="display:none">' . $this->__('Less ...') . '</a></li>';} ?></ol>
Coy Yang at Quora Visit the source
Related Q & A:
- How do I display all categories on a page with a corresponding image?Best solution by Magento
- How do I display limited html content in a webview?Best solution by Stack Overflow
- How can I display data in a listview?Best solution by Stack Overflow
- How do I display a picture?Best solution by Drupal Answers
- How do I make a mail list?Best solution by Yahoo! Answers
Just Added Q & A:
- How many active mobile subscribers are there in China?Best solution by Quora
- How to find the right vacation?Best solution by bookit.com
- How To Make Your Own Primer?Best solution by thekrazycouponlady.com
- How do you get the domain & range?Best solution by ChaCha
- How do you open pop up blockers?Best solution by Yahoo! Answers
For every problem there is a solution! Proved by Solucija.
-
Got an issue and looking for advice?
-
Ask Solucija to search every corner of the Web for help.
-
Get workable solutions and helpful tips in a moment.
Just ask Solucija about an issue you face and immediately get a list of ready solutions, answers and tips from other Internet users. We always provide the most suitable and complete answer to your question at the top, along with a few good alternatives below.