newscoop/publishingplatforms-plugin-bundle

Newscoop 的 PublishingPlatforms 插件。将新闻coop文章正文元素转换为FBIA和AMP标签。

dev-master 2016-08-16 20:24 UTC

This package is auto-updated.

Last update: 2024-09-24 04:33:33 UTC


README

插件为 Newscoop 提供了支持 Google AMP 和 Facebook Instant Articles 的功能。插件为文章创建特殊的路由/URL,并启用 smarty 修饰符,可以将文章正文 HTML 转换为 AMP/FBIA 兼容版本。

此插件与 Newscoop 4.4.7 及更高版本兼容。

安装

安装过程简单快捷

  1. 如何安装此插件?
  2. 这就完了!

步骤 1: 如何安装此插件?

运行以下命令

$ php application/console plugins:install "newscoop/publishingplatforms-plugin-bundle"
$ php application/console assets:install public/

插件将被安装到您的项目目录 newscoop/plugins/Newscoop

步骤 2: 就这么简单!

转到 Newscoop 管理面板,然后打开 插件 选项卡。插件会显示在那里。您现在可以使用此插件了。

注意

要更新此插件,请运行以下命令

$ php application/console plugins:update "newscoop/publishingplatforms-plugin-bundle"
$ php application/console assets:install public/

要删除此插件,请运行以下命令

$ php application/console plugins:remove "newscoop/publishingplatforms-plugin-bundle"

文档

Google AMP

修饰符

{{ $gimme->article->full_text|amp }}

文章 AMP 版本的路由

模式: /amp/{languageCode}/{issueUrl}/{sectionUrl}/{articleNumber}/{articleSeo}.htm"

加载的模板路径: _publishingPlatforms/amp/article.tpl

路由名称: newscoop_publishingplatforms_amp_article

生成指向 AMP 版本的链接

{{ generate_url route="newscoop_publishingplatforms_amp_article" absolute=true parameters=[
    'languageCode' => $gimme->article->language->code,
    'issueUrl' => $gimme->article->issue->url_name,
    'sectionUrl' => $gimme->article->section->url_name,
    'articleNumber' => $gimme->article->number,
    'articleSeo' => $gimme->article->seo_url_end
] }}

Facebook Instant Articles

{{ $gimme->article->full_text|fbia }}

更改用于渲染文章内容中图片的模板文件

在渲染文章内容字段之前使用此函数: {{ set_content_image_template name="editor_image_fbia.tpl" }}

editor_image_fbia.tpl 的示例可以在本插件中找到:Resources/views/default_templates/fbia/editor_image_fbia.tpl

set_content_image_template 会告诉 Newscoop 使用自定义模板文件来处理文章内容中的图片。

在文件末尾,使用 {{ reset_content_image_template }} 重置您的更改

许可证

此包采用 GNU 通用公共许可证 v3。请参阅包中的完整许可证。

LICENSE

关于

此包是 Sourcefabric z.ú. 的一项倡议。