Hy!我試圖在cms頁面上顯示類別。我嘗試了網絡上的所有解決方案,但沒有一個適用於我。我試過的最後一個是這個。Magento靜態模塊現在顯示在CMS頁面
1.I've在我的CMS頁面的內容標籤添加以下代碼: {{塊類型= 「目錄/導航」 模板= 「目錄/類別/ list.phtml」}}
2。我已經創建了list.phtml,並將該文件放在app/design/theme-name/template/catalog/category中。
這裏是代碼我pf的文件
<?php foreach ($this->getStoreCategories() as $_category): ?>
<?php $open = $this->isCategoryActive($_category); ?>
<?php
$cur_category=Mage::getModel('catalog/category')->load($_category->getId());
$layer = Mage::getSingleton('catalog/layer');
$layer->setCurrentCategory($cur_category);
if ($immagine = $this->getCurrentCategory()->getImageUrl()):
?>
<div class="catalog-image">
<div>
<a href="<?php echo $this->getCategoryUrl($_category)?>">
<img src="<?php echo $immagine ?>" alt="<?php echo $this->htmlEscape($this->getCurrentCategory()->getName()) ?>" width="313" height="151" />
</a>
</div>
<div class="left"><h2><a href="<?php echo $this->getCategoryUrl($_category)?>"><?php echo $_category->getName()?></a></h2></div>
</div>
<?php endif; ?>
<?php endforeach; ?>
我做錯了什麼?謝謝 !
您尚未在靜態塊中提供類別標識。 –