1.搜索引擎结果的面包屑导航里 显示公司名字:
见:https://search.google.com/structured-data/testing-tool
修改head标签为
1 |
<head itemscope itemtype="http://schema.org/WebSite"> |
插入网址
1 |
<link rel="canonical" href="https://example.com/" itemprop="url"> |
在公司名称部分加入itemprop=’name’,如:
1 |
<title itemprop='name'>Your WebSite Name</title> |
2.面包屑结构化
Zzz_template.asp 添加函数,1813行左右
1 2 3 4 5 |
'获取上级分类名称 Function getPname(Sid) on error resume next getPname=dbsqlone("select S_name from [dbpre]Sort where SID="&Sid&"") End Function |
1638行增加标签内容替换代码,这里替换内容页面
1 2 |
Zcontent=ReplaceStr(Zcontent,"[news:pslink]",getSortLink(rs("c_Type"),rs("S_PID"),rs("s_Url"),rs("s_Folder"),rs("s_FileName"),rs("S_GID"),rs("S_Exc"))) Zcontent=ReplaceStr(Zcontent,"[news:psname]",getPname(rs("S_PID"))) |
615行增加标签替换代码,这里替换列表页面
1 2 3 |
Zcontent=ReplaceStr(Zcontent,"{zzz:pslink}",getSortLink(stype,upsid,sorturl,S_Folder,S_FileName,"0","")) Zcontent=ReplaceStr(Zcontent,"{zzz:slink}",getSortLink(stype,sid,sorturl,S_Folder,S_FileName,"0","")) Zcontent=ReplaceStr(Zcontent,"{zzz:psname}",getPname(upsid)) |
内容页调用:底层判断父id=0,则父id=当前分类id,当前分类需要加个if功能隐藏掉
1 2 3 |
<ol itemscope itemtype="http://schema.org/BreadcrumbList"><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="{zzz:sitepath}" itemprop="item"><span itemprop="name">HOME</span></a> > <meta itemprop="position" content="1" /></li> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="[news:pslink]" itemprop="item"><span itemprop="name">[news:psname]</span></a> > <meta itemprop="position" content="2" /></li> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="[news:slink]" itemprop="item"><span itemprop="name">[news:sname]</span></a><meta itemprop="position" content="3" /></li></ol> |
列表页调用:
1 2 3 |
<ol itemscope itemtype="http://schema.org/BreadcrumbList"><li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="{zzz:sitepath}" itemprop="item"><span itemprop="name">HOME</span></a> > <meta itemprop="position" content="1" /></li> <li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"><a href="{zzz:pslink}" itemprop="item"><span itemprop="name">{zzz:psname}</span></a><meta itemprop="position" content="2" /></li> {if:{zzz:psid}=0}{else}<li itemprop="itemListElement" itemscope itemtype="http://schema.org/ListItem"> > <a href="{zzz:slink}" itemprop="item"><span itemprop="name">{zzz:sname}</span></a><meta itemprop="position" content="3" /></li>{end if}</ol> |
未经允许不得转载:Windy's Blog » ZZZcms 结构化数据修改