关注安徽站长创业、网站优化、网站推广及搜索引擎优化(SEO)的自媒体平台,分享最新的seo和网站优化知识

如何实现不同模型的【搜索页和标签列表页】展示样式不一样?

发布:雷都SEO2023-5-9 10:18分类: lecms使用手册

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更换一下即可!

【AKCMS建站交流QQ群:174110734】

转载请注明:本文《如何实现不同模型的【搜索页和标签列表页】展示样式不一样?》链接: http://seo.leidu.net/post-474.html

百度已收录

已有 0/77 人参与

发表评论:

欢迎分享合肥SEO自媒体

合肥网站SEO

欢迎使用手机扫描访问本站,还可以关注微信哦~