承接 drupal-pattern-lab/unified-twig-extensions 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

drupal-pattern-lab/unified-twig-extensions

最新稳定版本:v0.1.0

Composer 安装命令:

composer require drupal-pattern-lab/unified-twig-extensions

包简介

Share Pattern Lab's custom Twig extensions with Drupal 8.

README 文档

README

Share Pattern Lab's custom twigs functions, filters and tags with Drupal 8. Huzzah!

Getting Started

Simply add to Drupal and enable the Unified Twig Extensions module on the admin/modules page to get started.

Note on Paths

Note: currently looks for compatible extensions in your current active D8 theme path + either the 'pattern-lab/source/_twig-components' or 'source/_twig-components' folders. @TODO: allow users to customized / override this!

Included Examples

I'm including a couple example twig extensions to add to your existing Pattern Lab-enabled theme to get started:

  1. example/_twig-components/functions/link.function.php --> example of having Drupal ignore a PL Twig extension given the link function already exists in Drupal.

  2. example/_twig-components/tags/grid.tag.php and example/_twig-components/tags/cell.tag.php --> example of a custom Twig tag that abstracts away some of the markup involved in an ITCSS-based grid system.

To test this out, try adding these two custom Twig tags to your theme's existing _twig-components folder and try adding the following HTML (to both PL's twig templates and/or a Drupal template):

{% grid 'o-grid--large' %} {% cell 'u-1/1 u-1/2@small u-2/3@medium' %} Grid cell {% endcell %} {% cell 'u-1/1 u-1/2@small u-1/3@medium' %} Grid cell {% endcell %} {% endgrid %}

Everything should be working as expected if you don't encounter any errors and the following HTML gets output (rendered of course):

<div class="o-grid o-grid--large"> <div class="o-grid__item u-1/1 u-1/2@small u-2/3@medium"> Grid cell </div> <div class="o-grid__item u-1/1 u-1/2@small u-1/3@medium"> Grid cell </div> </div>

统计信息

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

GitHub 信息

  • Stars: 9
  • Watchers: 0
  • Forks: 10
  • 开发语言: PHP

其他信息

  • 授权协议: Unknown
  • 更新时间: 2026-01-04

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固