博友想查看某个标签所在的文章,还需要点开标签才行,我就想到给标签设置个提示,直接显示最近发布的3篇文章,请高手瞪一眼就走,哈哈
<div id="tags-list">
<?php $this->widget('Widget_Metas_Tag_Cloud', array('sort' => 'count', 'ignoreZeroCount' => true, 'desc' => true, 'limit' => 100))->to($tags); ?>
<?php while($tags->next()): ?>
<li class="tags-sub"><a href="<?php $tags->permalink(); ?>" title="" ><?php $tags->name(); ?> <sup><?php $tags->count(); ?></sup></a><ul>
<?php $this->widget('Widget_Archive@tag-' . $tags->mid, 'pageSize=5&type=tag', 'mid=' . $tags->mid)->to($posts); ?>
<?php while ($posts->next()): ?>
<li><?php $posts->date('m/d'); ?> <a href="<?php $posts->permalink(); ?>"><?php $posts->title(); ?></a></li>
<?php endwhile; ?>
</ul>
</li>
<?php endwhile; ?>
</div>
#tags-list {
padding:0;
margin:0;
}
.tags-sub {
padding:0;
margin:0 15px 15px 0;
display:inline-block
}
.tags-sub ul li {
list-style-type:none;
background:#f5f5f5;
border:1px solid #eee;
color:#444;
text-align:left;
padding:10px;
margin-bottom:-1px;
}
.tags-sub:hover ul {
display:block
}
.tags-sub ul {
padding:0;
margin:0;
width:auto;
z-index:99;
position:absolute;
display:none;
}