Voor een webshop wil ik een collapse menu gebruiken ipv van een dropdown menu wat ik nu heb.

De bootstrap dropdown menu werkt wel. Maar nu wil ik collapse menu gebruiken, maar die werkt niet. hier is de code

<?php


class CategorylinksTemplate extends ActiveTemplate {
	public function getHtml($var) {
		$html = '<ul>';
		$cats = WebshopModel::instance()->getCategories();

		$categories = array();
		foreach($cats AS $c){
			if($c->parent_id > 0){
				$categories[$c->parent_id]['child'][] = $c;
			} else { 
				$categories[$c->id]['parent'] = $c;
			}
		}

		foreach($categories as $cat) {
			$parent = $cat['parent'];
			$html .= '<li>';
			$html .= '<span class="glyphicons glyphicons-chevron-left"></span></a>';
			$html .= '<a href="'.$parent->url.'" class = "dropdown-toggle" data-toggle = "collapse">'.$parent->title.' <b class = "caret1"></b></a>';
			
			if(count(@$cat['child']) > 0){
				$html .= '<ul class = "dropdown-menu">';
				foreach($cat['child'] AS $c){
					$html .= '<li><a href="'.$c->url.'">'.$c->title.'</a></li>';
				}
				$html .= '</ul>';
			}
			$html .= '</li>'; 
		}
		$html .= '</ul>';

		return $html;
	}
}
?>


Hoop dat jullie me kunnen helpen :)

Reageren