定制 makinacorpus/drupal-static-passthrough 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

makinacorpus/drupal-static-passthrough

Composer 安装命令:

composer require makinacorpus/drupal-static-passthrough

包简介

Passthrough static html files to Drupal 8

README 文档

README

Drupal 8 Module - Passthrough static files to Drupal 8

Use cases with default config

You can see the explained default config in config/install/static_passthrough.settings.yml These settings can be modified/overwritten as all Drupal 8 settings.

Passthrough static templates

Configuration :

static_passthrough:
  directories:

    ...

    static:
      # Root path to get files
      root_path: 'dev/static'
      # Where to find files to passthrough (relative to DRUPAL_ROOT folder)
      root_dir: 'statics'
      # Who can access these files
      permission: 'access content'
      # Which kind of files are allowed
      allowed_extension: ['html', 'css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'ttf', 'otf', 'woff', 'woff2', 'eot' ]
      # Do files have to be include in Drupal structure (false) or displayed alone (true)
      standalone: false

    ...

Try it :

  1. Create a static folder in DRUPAL_ROOT directory.
  2. Put a test.html file in it which contains <h1>Hello word</h1>
  3. Then visit example.com/dev/static/test.html

The HTML is printed in the Content region in Front.

Passthrough documentation

Configuration :

static_passthrough:
  directories:

    ...

    documentation:
      # Root path to get files
      root_path: 'admin/doc'
      # Where to find files to passthrough (relative to DRUPAL_ROOT folder)
      root_dir: 'docs'
      # Who can access these files
      permission: 'access administration pages'
      # Which kind of files are allowed
      allowed_extension: ['html', 'css', 'js', 'png', 'jpg', 'jpeg', 'gif', 'ico', 'ttf', 'otf', 'woff', 'woff2', 'eot' ]
      # Do files have to be include in Drupal structure (false) or displayed alone (true)
      standalone: true

    ...

Try it :

  1. Create a docs folder in DRUPAL_ROOT directory.
  2. Put a index.html file in it which contains <h1>Hello word</h1>
  3. Then visit example.com/admin/doc

You're redirected to the standalone example.com/admin/doc/index.html file.

统计信息

  • 总下载量: 9.07k
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 2
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 2
  • Watchers: 1
  • Forks: 1
  • 开发语言: PHP

其他信息

  • 授权协议: GPL-2.0-or-later
  • 更新时间: 2019-10-16