我正在使用Fishpig Wordpress Extension的Magento网站 . 我们在左侧边栏中显示“类别”窗口小部件,并将其设置为显示层次结构 .
它的工作深度为两级(即ul&li的 .level0
和 .level1
),但没有显示3级深度,即 level2
我已经在一个基本的wordpress安装上测试了这个,我可以让它显示3个级别的类别,但我无法使用fishpig WordPress集成在Magento上工作 . 我已将帖子分配给所有子类别 .
我在 template/wordpress/sidebar/widget/categories.phtml
中看到有这个代码块来获取level1子类:
<?php else: ?>
<?php foreach($categories as $category): ?>
<li class="level0 item<?php if ($this->isCurrentCategory($category)): ?> active<?php endif; ?>">
<a class="level0" href="<?php echo $category->getUrl() ?>" title="<?php echo $category->getName() ?>">
<?php echo $category->getName() ?>
</a><?php if ($this->getCount()): ?> (<?php echo $category->getPostCount() ?>)<?php endif; ?>
<?php if ($this->getHierarchical()): ?>
<?php $children = $children = $category->getChildrenCategories() ?>
<?php if (count($children) > 0): ?>
<ul class="level1">
<?php foreach($children as $child): ?>
<?php if ($child->getPostCount() > 0): ?>
<li class="level1 item<?php if ($this->isCurrentCategory($child)): ?> active<?php endif; ?>">
» <a href="<?php echo $child->getUrl() ?>" title="<?php echo $child->getName() ?>" class="level1"><?php echo $child->getName() ?></a><?php if ($this->getCount()): ?> (<?php echo $child->getPostCount() ?>)<?php endif; ?>
</li>
<?php endif; ?>
<?php endforeach; ?>
</ul>
<?php endif; ?>
<?php endif; ?>
</li>
<?php endforeach; ?>
<?php endif; ?>
有没有办法在Fishpig上使用Magento显示超过两个级别的wordpress类别?
1 回答
我更新了
template/wordpress/sidebar/widget/categories.phtml
以包含第3级并且它有效:)