循环页面、分类、标签
03-18
<!--循环显示页面--> <?php $this->widget('Widget_Contents_Page_List')->to($pages); ?> <?php while($pages->next()): ?> <span class="nav-item<?php if($this->is('page', $pages->slug)): ?> nav-item-current<?php endif; ?>"> <a href="<?php%20$pages->permalink();%20?>" title="<?php $pages->title(); ?>"> <span><?php $pages->title(); ?></span> </a> </span> <?php endwhile; ?> <!--结束显示页面--> <!--循环所有分类--> <?php $this->widget('Widget_Metas_Category_List')->to($category); ?> <?php while ($category->next()): ?> <span class="nav-item<?php if($this->is('category', $category->slug)): ?> nav-item-current<?php endif; ?>"> <a href="<?php%20$category->permalink();%20?>" title="<?php $category->name(); ?>"> <span><?php $category->name(); ?></span> </a> </span> <?php endwhile; ?> <!--结束显示分类--> <!--循环显示标签 其中limit的5为显示数量--> <?php $this->widget('Widget_Metas_Tag_Cloud', array('sort' => 'count', 'ignoreZeroCount' => true, 'desc' => true, 'limit' => 5))->to($tags); ?> <?php while($tags->next()): ?> <span class="nav-item<?php if($this->is('tag', $tags->slug)): ?> nav-item-current<?php endif; ?>"> <a href="<?php%20$tags->permalink();%20?>" title="<?php $tags->name(); ?>"> <span><?php $tags->name(); ?></span> </a> </span> <?php endwhile; ?> <!--结束显示标签-->
声明:本站所有文章,如无特殊说明或标注,均为本站原创发布。任何个人或组织,在未征得本站同意时,禁止复制、盗用、采集、发布本站内容到任何网站、书籍等各类媒体平台。如若本站内容侵犯了原著者的合法权益,可联系我们进行处理。