请问这样在导航中调用分类正确吗?

模板开发以及发布测试

版主: seita

回复
Silyn
帖子: 5
注册时间: 2010年 1月 26日 01:55
联系:

请问这样在导航中调用分类正确吗?

帖子 Silyn »

代码: 全选

<?php $this->widget('Widget_Metas_Category_List')->to($category); ?>
<?php while($category->next()): ?>
<li<?php if($this->is('category', $category->slug)): ?> class="current"<?php endif; ?>><a href="<?php $category->permalink(); ?>" title="<?php $category->title(); ?>"><?php $category->name(); ?></a></li>
<?php endwhile; ?>


我试了下,可以正常使用,但是不确定是否正确!哪位高手能给个标准的写法,貌似我这样用了以后,在侧栏的默认调用分类会出错。
头像
m4go
帖子: 857
注册时间: 2010年 3月 29日 02:33
来自: https://www.vpshu.com
联系:

Re: 请问这样在导航中调用分类正确吗?

帖子 m4go »

如果你在顶部这样调用了,侧边栏,用同样的方式调用就可以了。原来的代码会错误。
回复