Hi,
dieses Template erstellt für den Textfilter eine alphabetische oder numerische Linkliste, was z.B. in Produktkatalogen die Suche nach Produktnamen erleichtert oder die Suche nach Postleitzahlen.
Viele Grüße,
Tim
dieses Template erstellt für den Textfilter eine alphabetische oder numerische Linkliste, was z.B. in Produktkatalogen die Suche nach Produktnamen erleichtert oder die Suche nach Postleitzahlen.
Viele Grüße,
Tim
PHP-Code:
<?php
/**
* Linklist (alphabetic or numeric) filter template
*/
?>
<?php
$arrInput = range('A','Z');
#$arrInput = range(0,9);
$arrOptions = array();
foreach($arrInput as $key)
{
$arrOptions[$key] = array
(
'id' => 'ctrl_'.$this->name.'_'.$key,
'href' => $this->addToUrl($this->name.'='.$key.'%'),
'label' => $key,
);
// check if filter is selected
if(\Input::get($this->name) == $key.'%')
{
$arrOptions[$key]['selected'] = true;
}
}
?>
<div <?php echo $this->cssID; ?> class="widget <?php echo $this->class; ?> block">
<fieldset class="linklist_container">
<?php if($this->label): ?><legend><?php echo $this->label; ?></legend><?php endif; ?>
<ul class="linklist">
<?php foreach($arrOptions as $option): ?>
<?php if($option['selected']): ?>
<li id="<?php echo $option['id']; ?>" class="sibling active"><a class="active" href="<?php echo $option['href']; ?>" title=""><?php echo $option['label']; ?></a>
<?php else: ?>
<li id="<?php echo $option['id']; ?>" class="sibling"><a href="<?php echo $option['href']; ?>" title=""><?php echo $option['label']; ?></a>
<?php endif;?>
<?php endforeach; ?>
</ul>
</fieldset>
<?php if($this->description): ?><div class="description"><?php echo $this->description; ?></div><?php endif; ?>
</div>
Kommentar