<?php
/***************************************************************************
 Extension Name  : Magento2 Shop By Brand Extension
 Extension URL   : http://www.magebees.com/magento2-shop-by-brand-extension.html
 Copyright    : Copyright (c) 2016 MageBees, http://www.magebees.com
 Support Email   : support@magebees.com 
 ***************************************************************************/
?>
<?php	//$helper = $this->helper('Magebees\Shopbybrand\Helper\Data'); ?>
<?php 	//if($helper->enableBrand()) : ?>
<div class="allBrands">
	<?php  echo "<h2 class=\"title\">All Brands</h2>";  ?>
	<?php 
		$collection =$block->_getallbrandCollection();
		foreach($collection as $key => $allbrand){
	?>
		<h4 class="letter"><?php echo $key ?></h4>
		<ul class="logoList">
			<?php $brandHTML=""; 
			foreach($allbrand as $brand){
				
				$img = $brand->getImageUrl();
				
				if(null !== $img && strlen($img)){
						$brandHTML.='<li class="allbrand">';                   
						$brandHTML.='<a href="'.$brand->getUrl().'">';
						$brandHTML.='<img src="'.$img.'" alt="'.$brand->getName().'"/>';
						$brandHTML.='</a>';
						$brandHTML.='</li>';
				}else{
						$brandHTML.='<li class="allbrand">';
						$brandHTML.='<a href="'.$brand->getUrl().'">'.$brand->getName().'</a>';
						$brandHTML.='</li>';
				}
				
					
				}	
			?>
		<?php ?>
			<?php echo $brandHTML; ?>
	    </ul>
		<?php } ?>
</div>

<?php // endif; ?>

