mid=2:文章模型
mid=3:产品模型
mid=4:图集模型
搜索文章和搜索产品、图集,结果页展示不同的样式~
{block:global_search pagenum="20" maxcount="200000"}
<div class="b1_top">
<div class="b1_cont">
{if:empty($gdata['list'])}
抱歉,未找到和 "<em>{$keyword}</em>"相关的内容。
{else}
{if:isset($_GET['mid']) && $_GET['mid']==3}
<div class="pro_list">
<ul class="cf">
{loop:$gdata[list] $v}<li><a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" title="{$v[title]}" target="_blank"><img rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" src="{$v[pic]}" /><u>{$v[subject]}</u></a></li>{/loop}
</ul>
<div class="pages cf"><span>共 <font color="red">{$gdata[total]}</font> 篇</span>{$gdata[pages]}</div>
</div>
{elseif:isset($_GET['mid']) && $_GET['mid']==4}
<div class="pho_list">
<ul class="cf">
{loop:$gdata[list] $v}<li><a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" title="{$v[title]}" target="_blank"><img rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" src="{$v[pic]}" /><u>{$v[subject]}</u></a></li>{/loop}
</ul>
<div class="pages cf"><span>共 <font color="red">{$gdata[total]}</font> 篇</span>{$gdata[pages]}</div>
</div>
{else}
<div class="art_list">
{loop:$gdata[list] $v}
<dl>
<dt><b><a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" title="{$v[title]}" target="_blank">{$v[subject]}</a></b></dt>
<dd>{$v[intro]}</dd>
</dl>
{/loop}
<div class="pages cf"><span>共 <font color="red">{$gdata[total]}</font> 篇</span>{$gdata[pages]}</div>
</div>
{/if}
{/if}
</div>
</div>
{/block}
如果想实现不同模型每页展示的数量也不一样~
{if:isset($_GET['mid']) && $_GET['mid']==3}
{block:global_search pagenum="10" maxcount="200000"}
<div class="b1_top">
<div class="b1_cont">
{if:empty($gdata['list'])}
抱歉,未找到和 "<em>{$keyword}</em>"相关的内容。
{else}
<div class="pro_list">
<ul class="cf">
{loop:$gdata[list] $v}<li><a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" title="{$v[title]}" target="_blank"><img rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" src="{$v[pic]}" /><u>{$v[subject]}</u></a></li>{/loop}
</ul>
<div class="pages cf"><span>共 <font color="red">{$gdata[total]}</font> 篇</span>{$gdata[pages]}</div>
</div>
{/if}
</div>
</div>
{/block}
{elseif:isset($_GET['mid']) && $_GET['mid']==4}
{block:global_search pagenum="20" maxcount="200000"}
<div class="b1_top">
<div class="b1_cont">
{if:empty($gdata['list'])}
抱歉,未找到和 "<em>{$keyword}</em>"相关的内容。
{else}
<div class="pho_list">
<ul class="cf">
{loop:$gdata[list] $v}<li><a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" title="{$v[title]}" target="_blank"><img rel="nofollow" rel="nofollow" rel="nofollow" rel="nofollow" src="{$v[pic]}" /><u>{$v[subject]}</u></a></li>{/loop}
</ul>
<div class="pages cf"><span>共 <font color="red">{$gdata[total]}</font> 篇</span>{$gdata[pages]}</div>
</div>
{/if}
</div>
</div>
{/block}
{else}
{block:global_search pagenum="30" maxcount="200000"}
<div class="b1_top">
<div class="b1_cont">
{if:empty($gdata['list'])}
抱歉,未找到和 "<em>{$keyword}</em>"相关的内容。
{else}
<div class="art_list">
{loop:$gdata[list] $v}
<dl>
<dt><b><a rel="nofollow" href="http://seo.leidu.net/go?url={$v[url]}" title="{$v[title]}" target="_blank">{$v[subject]}</a></b></dt>
<dd>{$v[intro]}</dd>
</dl>
{/loop}
<div class="pages cf"><span>共 <font color="red">{$gdata[total]}</font> 篇</span>{$gdata[pages]}</div>
</div>
{/if}
</div>
</div>
{/block}
{/if}
同理,标签内容列表页 tag_list.htm 也是一样的判断,只是把block更换一下即可!
转载请注明:本文《如何实现不同模型的【搜索页和标签列表页】展示样式不一样?》链接: http://seo.leidu.net/post-474.html
百度已收录
发表评论: