brainsum / tieto_tibr
dev-master
2018-02-23 17:40 UTC
This package is auto-updated.
Last update: 2022-02-01 13:15:44 UTC
README
Tieto Tibr集成
为Tieto内网上的Tibr提供集成。仅支持节点。
安装
- 在您的composer.json文件中将此添加为仓库
{
"type": "package",
"package": {
"name": "brainsum/tieto_tibr",
"version": "0.1.0",
"type": "drupal-module",
"source": {
"url": "https://github.com/brainsum/tieto_tibr",
"type": "git",
"reference": "master"
}
}
}
- 作为依赖项要求:
composer require brainsum/tieto_tibr
- 然后启用模块
使用
设置
- 将此添加到您的settings.php中
$config['tieto_tibr.settings'] = [
// Required.
'default_host' => 'tibr-host.com',
// Optional.
'alternative_hosts' => [
// Condition => tibr host.
'demo.example.com' => 'demo.tibr-host.com',
],
'mappings' => [
// Required. Has to be a file field and must not be empty.
'tibr_og_image' => 'field_my_image',
// Optional. Has to be a text field and must not be empty.
'tibr_og_description' => 'field_description',
],
];
-
键
- 需要
default_host
键,该键将被默认使用。 alternative_hosts
键是可选的。您可以使用它来指定替代主机。- 例如,如果您有en.example.com和de.example.com,并且希望为不同的URL使用不同的tibr主机。
alternative_hosts
中的键是条件,值是tibr主机。当条件满足时(即等于http主机),将使用适当的tibr主机。
- 需要
-
设置正确后,您需要在适当的模板中包含
tibr.twig.html
,例如在您的node.html.twig
中,如下所示{% include "@tieto_tibr/tibr.twig.html" ignore missing %}
tibr.twig.html
变量
- tibr_og_description
- 来自设置键
mappings.tibr_og_description
的字段值。
- 来自设置键
- tibr_og_image_absolute_url
- 来自设置键
mappings.tibr_og_image
的字段值。
- 来自设置键
- tibr_init_host
- 根据设置自动生成的值。
- tibr_tunnel_html_path
- 根据模块路径自动生成的值。
- tibr_og_title
- 自动生成的值,节点的标题。