nccategory.phtml
1.47 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
<?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>