2012-01-05 32 views
0

鏈接類別什麼是鏈接到從靜態塊類別和產品的最佳途徑。最好的辦法從靜態塊

我問,因爲有時我們會更新網址,鍵類等,這將打破靜態塊鏈接到給定類別和產品。

有沒有更好的方式使用IDS等這樣的鏈接會被激活,無論SEO友好的URL的鏈接?

目前,我使用的鏈接,例如: <a href="store.com/generators/generators.html?"generator_package=6>link</a>

當類別的URL更改上面的鏈接將被打破。

回答

0

這個怎麼樣?讓我知道結果,也許我們可以處理其他方式。

+++編輯 - 新的代碼示例+++ 首先創建一個靜態塊是該塊應該引用PHTML文件,你可以把你的邏輯放到這個文件。

{{block type="catalog/navigation" name="catalog.category" template="catalog/category/ListCategory.phtml"}} 

在/ app /設計/前端/ [YOUR_THEME] /模板/目錄/類別/目錄中創建ListCategory.phtml。

<?php 
// get current category id 
$curCategory = $this->getCurrentCategory()->getId(); 

// instance of Mage_Catalog_Model_Category 
$category = Mage::getModel(catalog/category)->load((int)$curCategory); 

// child category id array 
$childCategories = $category->getChildren(); 

?> 
+0

不幸的是,這個打印的前端:負載(6) - >的getURL()>「>鏈接 – vulgarbulgar 2012-01-10 20:40:32

+0

@vulgarbulgar嘗試這種新的。 – 2012-01-10 21:09:06