brainsum/tieto_tibr

此包已被弃用且不再维护。作者建议使用brainsum/tieto_modules包。

Tieto tibr功能模块的Drupal模块。

安装: 4

依赖项: 0

建议者: 0

安全: 0

星星: 0

观察者: 4

分支: 0

开放问题: 1

类型:drupal-module

dev-master 2018-02-23 17:40 UTC

This package is auto-updated.

Last update: 2022-02-01 13:15:44 UTC


README

Build Status

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
    • 自动生成的值,节点的标题。