我需要移动magento电子商务的"高级搜索"功能到侧边栏。
为了使它更紧凑,我想缩小"选择"框的大小。
高级搜索phtml文件中的代码如下所示:
<?php break;
case 'select': ?>
<div class="controls">
<?php echo $this->getAttributeSelectElement($_attribute) ?>
</div>
生成的html是:
<div class="controls">
<select name="stagione[]" id="stagione" class="multiselect" title="Stagionalità" multiple="multiple" size="4">
...
</select>
</div>
我怎么能纠正size="4"默认为size="1"可能只是在phtml文件上工作,而不触及核心magento文件?
在php文件中不可能这样做,因为选择的大小在Mage_CatalogSearch_Block_Advanced_Form::getAttributeSelectElement
中是硬编码的。
// 2 - avoid yes/no selects to be multiselects
if (is_array($options) && count($options)>2) {
$extra = 'multiple="multiple" size="4"';
$name.= '[]';
}