本文共 6987 字,大约阅读时间需要 23 分钟。
首页 目前有 <title> </title> <meta name="Keywords" content=" " /> 缺少:网站描述 <meta name="Description" content=" " /> 商品缺少:title=" " 描述 对于搜索引擎收录推广极为不利,建议增加,另外最好还能增加首页自定义文章分类。 修改后实现效果代码如下: <title>礼通商务礼品,深圳礼品商务礼品供应商,深圳商务礼品批发,礼品定制服务商</title> <meta http-equiv="Content-Type" content="text/html;charset=utf-8" /> <meta name="Keywords" content="礼通商务礼品,深圳礼品公司,深圳礼品商务礼品供应商,深圳礼品商务礼品网,深圳商务礼品批发团购,深圳礼品定制" /> <meta name="Description" content="礼通商务礼品,深圳礼品商务礼品供应商,深圳商务礼品批发,礼品定制服务商" /> <a href="index.php?app=goods&id=12" target="_blank" ><img src="./temp/thumb/91/c7/91c7eb1731fe387a60f8e86bfdedff5f39.jpg" alt="佳能450D 单反数码相机" /></a> <p class="infolist"><span class="name"><a href="index.php?app=goods&id=12" title="佳能450D 单反数码相机" target="_blank" >佳能450D 单反数码相机</a></span><span class="price" >¥5,655.00</span></p> 解决方法: 一、添加 Description 网站描述 修改:includes/models/mod.page.php 在 /* 生成keywords */ $keywords = &$head->createChild('meta'); $keywords->attributes = array('name'=>'Keywords', 'content'=>'{$meta_keywords}'); 下面添加: /* 生成Description */ $keywords = &$head->createChild('meta'); $keywords->attributes = array('name'=>'Description', 'content'=>'{$title}'); 二、商品添加 title=" " ●首页添加 title="{$rgoods.goods_name|escape}" 修改:themes/mall/resource/custom_module.html <!-- {if $custom_module.{index}.image_goods} --> <ul class="thumblist clearfix"> <!-- {foreach from=$custom_module.{index}.image_goods item=rgoods} --> <li> <a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" target="_blank" ><img src="{image file=$rgoods.default_image width=100 height=100}" alt="{$rgoods.goods_name|escape}" /></a> <p class="infolist"><span class="name"><a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" target="_blank" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.goods_name|truncate:24|escape}</a></span><span class="price" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.store_price|price}</span></p> </li> <!-- {/foreach} --> </ul> <!-- {/if} --> <!-- {if $custom_module.{index}.word_goods} --> <ul class="textlist clearfix"> <!-- {foreach from=$custom_module.{index}.word_goods item=rgoods} --> <li><a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" target="_blank" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.goods_name|escape|truncate:18}</a></li> <!-- {/foreach} --> </ul> <!-- {/if} --> <!-- {if $custom_module.{index}.hot_goods} --> <div class="toplist" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}> <h4>{$lang.top_hot}</h4> <ol {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}> <!-- {foreach from=$custom_module.{index}.hot_goods item=rgoods} --> <li><p><a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" target="_blank" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.goods_name|escape|truncate:20}</a></p></li> <!-- {/foreach} --> </ol> </div> <!-- {/if} --> 改成: <!-- {if $custom_module.{index}.image_goods} --> <ul class="thumblist clearfix"> <!-- {foreach from=$custom_module.{index}.image_goods item=rgoods} --> <li> <a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" target="_blank" ><img src="{image file=$rgoods.default_image width=100 height=100}" alt="{$rgoods.goods_name|escape}" /></a> <p class="infolist"><span class="name"><a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" title="{$rgoods.goods_name|escape}" target="_blank" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.goods_name|truncate:24|escape}</a></span><span class="price" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.store_price|price}</span></p> </li> <!-- {/foreach} --> </ul> <!-- {/if} --> <!-- {if $custom_module.{index}.word_goods} --> <ul class="textlist clearfix"> <!-- {foreach from=$custom_module.{index}.word_goods item=rgoods} --> <li><a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" title="{$rgoods.goods_name|escape}" target="_blank" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.goods_name|escape|truncate:18}</a></li> <!-- {/foreach} --> </ul> <!-- {/if} --> <!-- {if $custom_module.{index}.hot_goods} --> <div class="toplist" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}> <h4>{$lang.top_hot}</h4> <ol {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}> <!-- {foreach from=$custom_module.{index}.hot_goods item=rgoods} --> <li><p><a href="{url src=index.php?app=goods&id=$rgoods.goods_id}" title="{$rgoods.goods_name|escape}" target="_blank" {if $custom_module.{index}.content_fontcolor}style="color:{$custom_module.{index}.content_fontcolor};"{/if}>{$rgoods.goods_name|escape|truncate:20}</a></p></li> <!-- {/foreach} --> </ol> </div> <!-- {/if} --> ●商品列表:商品添加title="{$goods.goods_name|escape}" 修改:themes/mall/resource/goods_list.html <dd class="name"><a href="{url src=index.php?app=goods&spec_id=$goods.spec_id}" target="_blank"> {$goods.goods_name|escape}</a></dd> 改成: <dd class="name"><a href="{url src=index.php?app=goods&spec_id=$goods.spec_id}" title="{$goods.goods_name|escape}" target="_blank" >{$goods.goods_name|escape}</a></dd> ●团购商品 添加title="{$gbgoods.goods_name|escape}" 修改:themes/mall/resource/group_buy.html <p class="infolist"><span class="name"><a href="{url src=index.php? app=groupbuy&act=detail&id=$gbgoods.act_id}">{$gbgoods.goods_name|escape}</a></span><span class="price">{$gbgoods.ext.price|price}</span></p> 改成: <p class="infolist"><span class="name"><a href="{url src=index.php? app=groupbuy&act=detail&id=$gbgoods.act_id}" title="{$gbgoods.goods_name|escape}">{$gbgoods.goods_name|escape}</a></span><span class="price">{$gbgoods.ext.price|price}</span></p> ●团购列表 添加title="{$groupbuy.goods_name|escape}" 修改:themes/mall/resource/groupbuy_list.html <dd class="name"><a href="{url src=index.php?app=groupbuy&act=detail&id=$groupbuy.act_id}" target="_blank">{$groupbuy.goods_name|escape}</a></dd> 改成: <dd class="name"><a href="{url src=index.php?app=groupbuy&act=detail&id=$groupbuy.act_id}" title="{$groupbuy.goods_name|escape}" target="_blank">{$groupbuy.goods_name|escape}</a></dd> ●收藏商品 添加title="{$goods.goods_name|escape}" 修改:themes/mall/resource/mc_favorite.html <p class="name"><a href="index.php?app=goods&id={$goods.goods_id}" target="_blank">{$goods.goods_name|escape}</a></p> 改成: <p class="name"><a href="index.php?app=goods&id={$goods.goods_id}" title="{$goods.goods_name|escape}" target="_blank">{$goods.goods_name|escape}</a></p> 转载于:https://my.oschina.net/u/779687/blog/121759