PHPCMS搜索模板制作
- 搜索结果列表 templates\default\search\list.html
- 搜索关键字 {$search_q} 或 {$q}
- 搜索结果条数 {$totalnums}
- 搜索用时 {sprintf("%01.2f", $execute_time)} 秒
调用搜索结果,官方默认代码
<div class="c wrap">
    <ul class="wrap">
        {loop $data $i $r}
            <li class="wrap">
            <div>
                {if $r['thumb']}<a href="{$r[url]}"><img src="{$r[thumb]}" width="60" height="60" /></a>{/if}
                <h5><a href="{$r[url]}">{$r[title]}</a>{if $r['posids']}<img src="{IMG_PATH}icon/small_elite.gif">{/if}</h5>
                <p>{$r[description]}</p>
            </div>
            <div class="adds">发布时间:{format::date($r[inputtime], 1)}</div>
            </li>
        {/loop}
        {if empty($data)}未找到结果{/if}
    </ul>
    <div id="pages" class="text-c mg_t20">{$pages}</div>    
</div>
注意事项:在调用代码之前不能有pc标签,包括栏目调用或文章列表调用,否则将无法调出搜索结果列表
版权声明:本文为李维亮博主的原创文章,遵循CC 4.0 BY-SA版权协议,转载请附上原文出处链接及本声明。
        
            
    
            
    
            
    
            
    
            
    
        
    原文链接:https://www.liweiliang.com/472.html
        
    
    - 上一篇: PHPCMS如何调用多个分类栏目的最新文章
- 下一篇: PHPCMS模板制作精髓
评论已关闭