跳转到主要内容

为collective.perseo包添加Schema.org属性

项目描述

简介

此包定制main_template、plone.path_bar、plone.global_sections、plone.header视图以插入Schema.org属性(itemscope、itemtype和itemprop)。

警告!安装此包时,main_template、plone.path_bar、plone.global_sections、plone.header视图将被定制,以插入Schema.org属性。这些资源在其他主题和皮肤中的定制可能被禁用。

如果您不想安装collective.perseoschema包,但仍然需要Schema.org属性,以下是在您的主题中可以进行的定制:

在以下位置定制plone.path_bar视图

  • path_bar.pt的第2行,添加itemprop属性,itemprop="breadcrumb"

    <div id="portal-breadcrumbs"
             itemprop="breadcrumb"
    ...

在以下位置定制plone.global_sections视图

  • section.pt的第1行,在标签nav中添加itemscope和itemtype属性,itemtype="http://schema.org/SiteNavigationElement"

    <nav itemscope="itemscope"
             itemtype="http://schema.org/SiteNavigationElement">
             ...
    </nav>

在以下位置定制plone.header视图

  • portal_header.pt的第2行,添加itemscope和itemtype属性,itemtype="http://schema.org/WPHeader"

    <div id="portal-header"
             itemscope="itemscope"
         itemtype="http://schema.org/WPHeader">
         ...

在以下位置定制sunburst_templates / main_template

  • 第18行,从Plone SEO配置中获取“向body标签添加itemscope和itemtype属性”字段的值,并从SEO选项卡获取“itemtype属性”字段的值

    ...
    <html xmlns="http://www.w3.org/1999/xhtml"
        tal:define="
            ...
            perseo_context nocall: context/@@perseo-context;
                    itemscope_itemtype python:perseo_context.perseo_itemscope_itemtype();
                    itemtype python:perseo_context.perseo_itemtype()"
    ...
  • 第61行,添加itemscope和itemtype属性(根据先前值)

    ...
    <body ...
        tal:attributes="...
                        itemscope python:itemscope_itemtype and 'itemscope' or None;
                        itemtype python:itemscope_itemtype and itemtype or None">
    ...
  • 第94行,添加itemprop属性,itemprop="mainContentOfPage"

    ...
    <div id="content" itemprop="mainContentOfPage">
    ...
  • 第149行,添加了itemscope和itemtype属性,itemtype="http://schema.org/WPSideBar"

    ...
    <div id="portal-column-one"
            itemscope="itemscope"
            itemtype="http://schema.org/WPSideBar"
    ...
  • 第161行,添加了itemscope和itemtype属性,itemtype="http://schema.org/WPSideBar"

    ...
    <div id="portal-column-two"
            itemscope="itemscope"
            itemtype="http://schema.org/WPSideBar"
    ...
  • 第176行,添加了itemscope和itemtype属性,itemtype="http://schema.org/WPFooter"

    ...
    <div itemscope="itemscope" itemtype="http://schema.org/WPFooter">
            <div tal:replace="structure provider:plone.portalfooter" />
    </div>
    ...

致谢

在Andrea Pernici的支持下开发。collective.perseo是基于quintagroup.seoptimizer的。

作者

本产品由RedTurtle技术团队开发。

RedTurtle Technology Site

变更日志

0.1.1 (2011-12-14)

  • 修复了seo标签中字段的布局 [fdelia]

0.1.0 (2011-10-19)

  • 初始发布

项目详情


下载文件

下载适用于您的平台的文件。如果您不确定选择哪个,请了解更多关于安装包的信息。

源代码分发

collective.perseoschema-0.1.1.tar.gz (19.7 kB 查看哈希值)

上传时间 源代码

支持者