nccategory.phtml 1.47 KB

<?php $_helper    = $this->helper('catalog/output'); ?>
<?php $_category  = $this->getCurrentCategory(); ?>

<?php $ncalbum  = $this->getNcalbumcategory();  ?>
<?php $ncimage = Mage::helper('anc_album/ncmodel')->getFirstImageFromNcalbum($ncalbum['entity_id']); ?>
<?php
if(is_object($ncimage)) {
	$_imageUrl= Mage::helper('anc_image/ncimage')->getNcImagePath($ncimage->getId(), 'relative', 'thumbnail');
} else {
	$_imageUrl= null;
}

?>
<?php $ChildCategorie = $this->getChildCategorie(); ?>


<div class="category">
	<li class="category-name">
		<a href="/<?php echo Mage::helper('anc_album/nccategory')->getCategoryUrl($ChildCategorie, $ncalbum)?>">
			<?php if($ncalbum['name']): ?>
				<?php echo $ncalbum['name']; ?>
			<?php else: ?>
				<?php echo $ChildCategorie->getName()?>
			<?php endif; ?>
		</a>
	</li>
	<div class="category-image">
		<a href="/<?php echo Mage::helper('anc_album/nccategory')->getCategoryUrl($ChildCategorie, $ncalbum)?>">
			<?php if($_imageUrl): $_imageUrl = '/'.$_imageUrl; ?>
			<?php elseif($_imageUrl=$ncalbum['imageUrl']):?>
			<?php elseif($_imageUrl=$ChildCategorie->getImageUrl()): ?>
			<?php elseif($_imageUrl=$_category->getImageUrl()): ?>
			<?php elseif($_imageUrl=$_category->getParentCategory()->getImageUrl()): ?>
			<?php endif;?>								
			<img src="<?php echo $_imageUrl?>" height="188">
		</a>
	</div>
	<?php if($ncalbum['coment']): ?>
		<div class="category-description"><?php echo $ncalbum['coment'] ?></div>
	<?php endif; ?>									
</div>