您认为标记蜗牛邮件地址的最佳方式是什么?我找到了一些不同的选项,例如:
<div class="address">
<span class="name">Mr. Bob</span><br/>
<span class="street">45654 Bob Ln</span><br/>
<span class="city">Imaginery</span>,<span class="state">OH</span><br/>
<span class="postalCode">44321</span>
</div>
Run Code Online (Sandbox Code Playgroud)
我还看到了前面的示例使用地址标记而不是div.我找到的另一个选择是:
<div class="address">
<p>Mr. Bob</p>
<p>45654 Bob Ln</p>
<p>Imaginery, OH</p>
<p>44321</p>
</div>
Run Code Online (Sandbox Code Playgroud)
所以我的问题是你认为表达蜗牛邮件地址的最佳标记是什么?并且不要局限于我的例子.
我觉得第一个是最好的选择,因为它提供了关于每个元素的附加上下文.在这种情况下,我也觉得br是内容的一部分.
我正在尝试为openshours创建一个schema.org定义,该定义在Google的丰富网页摘要测试工具中得到验证.
有了这个标记,我想在星期一定义一个商店从11:00-22:00开放.
<time datetime="Mo 11:00-22:00" itemprop="openingHours">11:00-22:00</time>
Run Code Online (Sandbox Code Playgroud)
但是,丰富的片段测试工具显示:
警告:openinghours是指不是ISO 8601的日期时间格式.
Schema.org 定义:
一个企业的营业时间.开放时间可以指定为每周时间范围,从天数开始,然后是每天的时间.可以使用逗号','列出多天,每天分隔.使用连字符" - "指定日期或时间范围.
使用以下两个字母组合指定天数:Mo,Tu,We,Th,Fr,Sa,Su.
时间是使用24:00时间指定的.例如,下午3点被指定为15:00.
这是一个例子:
<time itemprop="openingHours" datetime="Tu,Th 16:00-20:00">Tuesdays and Thursdays 4-8pm</time>
RDFa,Microformats和Microdata提供了包含语义标记的简单方法.还有其他类似的技术吗?
谢谢
我目前对微数据和schema.org有点困惑.microodata和schema.org是一样的吗?我阅读了谷歌和微软的文档,但这并没有帮助我区分这两个名字.
到目前为止,我明白我已经制作了这个HTML代码:
<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/" itemprop="url"><span itemprop="title">My Page</span></a>
</span>
<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/cat1" itemprop="url"><span itemprop="title">Category 1</span></a>
</span>
<span itemscope itemtype="http://data-vocabulary.org/Breadcrumb">
<a href="/cat1/content" itemprop="url"><span itemprop="title">Content</span></a>
</span>
Run Code Online (Sandbox Code Playgroud)
在我看来,太多的开销,但如果搜索结果看起来不错,那就没关系.是否可以减少html代码的数量?
此外,如果我不需要,搜索引擎如何检测两个不同的路径?
我的下一个问题是我想将这种格式应用于drupal breadcrumps.我在网上找到了这个修复程序,我试图将其包含在我自己的SEO模块中,如下所示:
function mymod_page_alter(&$variables) {
if (!isset($variables['breadcrumb'])) {
$variables['breadcrumb'] = theme('my_microdata', array('breadcrumb' => drupal_get_breadcrumb()));
}
}
function mymod_theme($existing, $type, $theme, $path) {
return array(
'my_microdata' => array(
'variables' => array('breadcrumb' =>array()),
),
);
}
function mymod_menu_breadcrumb_alter(&$active_trail, $item){
foreach($active_trail as $id=>$active_trail_item){ …Run Code Online (Sandbox Code Playgroud) 我breadcrumb使用Google Rich Snippets测试工具测试了Schema.org 示例.
<div itemprop="breadcrumb">
<a href="category/books.html">Books</a> >
<a href="category/books-literature.html">Literature & Fiction</a> >
<a href="category/books-classics">Classics</a>
</div>
Run Code Online (Sandbox Code Playgroud)
结果是该工具无法识别.
那么,是否存在错误或存在语法问题?如果是这样,那么正确的语法是什么?
我在我的网站上使用微数据,特别是LocalBusiness模式.我也读到了这个:schema.org:同一天的多个开放时间
但我想要的是每天定义开放时间是什么,因为它们可能会有很大不同.
我目前在其他例子中看到的是:
<time itemprop="openingHours" datetime="Tu-Fr 10:00-14:00">XYZ</time>
Run Code Online (Sandbox Code Playgroud)
我还可以使用这些选项中的任何一个吗?
<time itemprop="openingHours" datetime="Tu 10:00-14:00">XYZ</time>
<time itemprop="openingHours" datetime="Fr 11:00-14:00">XYZ</time>
Run Code Online (Sandbox Code Playgroud)
或这个
<meta itemprop="openingHours" content="Tu 10:00-14:00">XYZ
<meta itemprop="openingHours" content="FR 11:00-14:00">XYZ
Run Code Online (Sandbox Code Playgroud)
不仅如此,在某些日子里,企业可能只能通过预约开放.怎么指定?我假设当我在<time>规范中离开一天时,它将被解释为关闭,但是通过预约我不知道.
**更新**
我现在有这个:
<div itemprop="openingHoursSpecification" itemscope="" itemtype="http://schema.org/OpeningHoursSpecification">
<link itemprop="dayOfWeek" href="http://purl.org/goodrelations/v1#Monday">
<time datetime="07:00">07:00</time> - <time datetime="01:00">01:00</time>
</div>
Run Code Online (Sandbox Code Playgroud)
我现在看到了Google丰富的代码段工具
项目类型:http://schema.org/localbusiness
property:
name:Syriana
description:
address:Item 1
openinghoursspecification:Item 2
openinghoursspecification:Item 3
第2项
类型:http://schema.org/openinghoursspecification
property:
dayofweek:http://purl.org/goodrelations/v1#Monday
我看到了这一天,但不是丰富的片段工具中的时间......为什么?
Google和其他人如何确定itempropAnchor标记的价值?
<a href="foo.html" itemprop="barprop">Name Of Link</a>
Run Code Online (Sandbox Code Playgroud)
在上面的例子中,itemprop的值是href属性,就像link解析标签的方式一样?或者是innerHTML作为标准块元素被解析的值?
我搜索了很多,但找不到答案.我对所有答案持开放态度,但我非常喜欢给出答案的来源,所以我可以进一步调查.
提前致谢!
我们当前在CakePHP框架上使用TinyMCE(版本:3.3.9.2(2010-09-29)),并尝试tiny_mce/themes/advanced/editor_template.js通过添加以下内容来修改Advance Themes文件以接受Microdata语法(用于使用Schema.org词汇)串:
extended_valid_elements : "p[itemtype|itemscope|itemprop|id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup]",
Run Code Online (Sandbox Code Playgroud)
和/或
extended_valid_elements : "@[itemtype|itemscope|itemprop|id|class|style|title|dir<ltr?rtl|lang|xml::lang|onclick|ondblclick|onmousedown|onmouseup|onmouseover|onmousemove|onmouseout|onkeypress|onkeydown|onkeyup]",
Run Code Online (Sandbox Code Playgroud)
引用此调试代码段:http ://www.tinymce.com/develop/bugtracker_view.php? id=4469
但是,当我们修改文件并刷新时,即使我们在HTML源代码编辑器中进行了测试<p itemtype="def">This is some content.</p> 或 <div itemscope itemtype="http://schema.org/Movie">This is some content.</div>作为测试,所有内容都将被剥离。
任何人都对如何解决或使TinyMCE继续剥离结构化数据有什么想法?
我正在使用AggregateRating标记将结构化数据实现到应用程序中。问题是当存在0个等级时,等级值为空。使用Google结构化数据测试工具时出现以下错误。
字段ratingValue不能为空。
<div itemprop="aggregateRating" itemscope itemtype="http://schema.org/AggregateRating">
<meta itemprop="reviewCount" content="0">
<meta itemprop="ratingValue" content="">
...
</div>
Run Code Online (Sandbox Code Playgroud)
该应用使用默认的1到5评分等级。
是否存在符合Schema.org的默认值,当ratingValue值为空时可以将其传递给它?我不想为了避免错误而按比例传递任意数字...
我在网页上有以下项目,我将其定义为Scheme.org Article.详细信息已被禁止,但所有正版URL都有效.
<div itemscope itemtype="http://schema.org/Article" class="large-6 columns related blog">
<meta itemprop="publisher" content="My Company" />
<meta itemprop="dateModified" content="February 4, 2016" />
<meta itemprop="mainEntityOfPage" content="http://example.co.uk/main-page/" />
<div>
<h2 itemprop="headline" class="stretch_this"><a itemprop="url" href='http://example.co.uk/main-page/'>Article title</a></h2>
<p>Posted by <span itemprop="author">A N Other</span> on <span itemprop="datePublished">February 4, 2016</span></p>
<img itemprop="image" class="post_preview" alt='Article title' class="hide-for-small" src="http://example.co.uk/wp-content/uploads/2016/02/example-image.jpg" />
<p itemprop="text">Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco …Run Code Online (Sandbox Code Playgroud) microdata ×10
schema.org ×6
html5 ×3
breadcrumbs ×2
html ×2
microformats ×2
seo ×2
cakephp ×1
date ×1
drupal ×1
javascript ×1
markup ×1
php ×1
rdfa ×1
tinymce ×1