Danke an euch beide - es ist geschafft ;-)
das fertige template sieht nun wie folgt aus und funktioniert soweit auch:
PHP-Code:
<form action="" class="<?php echo $this->level; ?>">
<select id="blogcat" >
<?php foreach ($this->items as $item): ?>
<?php if((trim(Environment::get('requestUri'),'/')) == $item['href']): ?>
<option value="<?php echo $item['href']; ?>" selected class="<?php echo $item['class']; ?>"><span class="<?php echo $item['class']; ?>"><?php echo $item['link']; ?></span><?php if ($this->showQuantity): ?> <span class="quantity">(<?php echo $item['quantity']; ?>)</span><?php endif; ?><?php echo $item['subitems']; ?>
</option>
<?php else: ?>
<option value="<?php echo $item['href']; ?>" class="<?php echo $item['class']; ?>"><span class="<?php echo $item['class']; ?>"><?php echo $item['link']; ?></span><?php if ($this->showQuantity): ?> <span class="quantity">(<?php echo $item['quantity']; ?>)</span><?php endif; ?><?php echo $item['subitems']; ?>
</option>
<?php endif; ?>
<?php endforeach; ?>
</select>
</form>
<script>
(function(){
var dropdown = document.getElementById("blogcat");
function onCatChange(){
if(dropdown.options[dropdown.selectedIndex].selectedIndex != 0){
parent.location.href = "http://cto.jutima.at/" + dropdown.options[dropdown.selectedIndex].value;
}
}
dropdown.onchange = onCatChange;
})(jQuery);
</script>
Lesezeichen