All Projects → BurdaPraha → DrupalTwigFood

BurdaPraha / DrupalTwigFood

Licence: GPL-2.0 license
Useful functions, filters for twig @ Drupal 8

Programming Languages

PHP
23972 projects - #3 most used programming language

Projects that are alternatives of or similar to DrupalTwigFood

fractal-twig-drupal-adapter
Twig template adapter for Fractal with Drupal 8 directives.
Stars: ✭ 13 (+1200%)
Mutual labels:  twig, drupal, drupal-8
apigee-api-catalog-drupal
Manage your API catalog within Drupal's content management approach
Stars: ✭ 17 (+1600%)
Mutual labels:  drupal, drupal-8
drupal-jsonapi-params
A package to manage json-api params
Stars: ✭ 42 (+4100%)
Mutual labels:  drupal, drupal-8
drupal-react-image-gallery
Drupal 8 module that provides a dynamic Image Gallery based on the react-image-gallery component.
Stars: ✭ 13 (+1200%)
Mutual labels:  drupal, drupal-8
drupal8-oop
Tutorial for object-oriented programming fundamentals in PHP
Stars: ✭ 37 (+3600%)
Mutual labels:  drupal, drupal-8
drupal-template-helper
Debug Drupal 8 templates in Chrome Devtools. drupal-template-helper is a chrome extension for Drupal that lists all available templates and the preprocess hooks to use to customize your templates.
Stars: ✭ 115 (+11400%)
Mutual labels:  twig, drupal
apigee-devportal-kickstart-drupal
A fast demo and starting point for Apigee Developer Portals for Drupal
Stars: ✭ 21 (+2000%)
Mutual labels:  drupal, drupal-8
Htmlpurifierbundle
HTML Purifier is a standards-compliant HTML filter library written in PHP.
Stars: ✭ 234 (+23300%)
Mutual labels:  twig, filter
breadcrumb-bundle
Symfony bundle for easy breadcrumbs management
Stars: ✭ 26 (+2500%)
Mutual labels:  twig, twig-extension
composer-tutorial
A walk through of various Composer tasks
Stars: ✭ 40 (+3900%)
Mutual labels:  drupal, drupal-8
drupal-composer-init
Initialise a Drupal composer setup
Stars: ✭ 43 (+4200%)
Mutual labels:  drupal, drupal-8
dkan2
Deprecated: please use the 2.x branch of the dkan repo
Stars: ✭ 17 (+1600%)
Mutual labels:  drupal, drupal-8
AdBlock-Acceleration
Accelerated subscription for international/China region ad filtering rules(国际/中国地区广告过滤规则的加速订阅)
Stars: ✭ 327 (+32600%)
Mutual labels:  filter, region
Slugify
Converts a string to a slug. Includes integrations for Symfony, Silex, Laravel, Zend Framework 2, Twig, Nette and Latte.
Stars: ✭ 2,697 (+269600%)
Mutual labels:  twig, twig-extension
drupal8-vagrant
Simple Drupal 8 Development Environment
Stars: ✭ 59 (+5800%)
Mutual labels:  drupal, drupal-8
drupal-circleci-behat
Test and deploy Drupal 9 with CircleCI 2.0 and Behat 3
Stars: ✭ 17 (+1600%)
Mutual labels:  drupal, drupal-8
Bolt
The Bolt Design System provides robust Twig and Web Component-powered UI components, reusable visual styles, and powerful tooling to help developers, designers, and content authors build, maintain, and scale best of class digital experiences.
Stars: ✭ 186 (+18500%)
Mutual labels:  twig, drupal
Reactrenderer
Client and Server-side React rendering from PHP
Stars: ✭ 201 (+20000%)
Mutual labels:  twig, twig-extension
DrupalDriver
A collection of drivers for controlling Drupal.
Stars: ✭ 64 (+6300%)
Mutual labels:  drupal, drupal-8
gatsby-drupal-kit
A Gatsby V2 starter kit designed to work with a new Drupal 8 site.
Stars: ✭ 23 (+2200%)
Mutual labels:  drupal, drupal-8

DrupalTwigFood

Useful functions, filters for twig @ Drupal 8

Instalation

Recomended using is via Composer: composer require burdapraha/drupal_twig_food ... and install module "Burda Twig Food" in administration (domain.tld/admin/modules)

Documentation

The best documentation is easy examples, right? :-)

Functions

- svg($path)

offering comfortably using svg images in templates, example: {{ svg('awesome_icon.svg') }} when file is stored in "/your-theme-name/images/awesome_icon.svg" and source code of svg will be printed to page as is. This solution is quick and you can use CSS features like ".your-div svg {fill: red}" etc.

- load_block($id)

you can call block by name anywhere in template: {{ load_block('machine_name') }}

- load_region($id)

this function offers print all block of the region anywhere you need: {{ load_region('machine_name') }}

- load_main_node($returnId = true)

solving problem with getting node id from anywhere template when you need it {{ load_main_node() }}

- load_gallery_prev($currentGalleryId, $thumbnailStyle = 'thumbnail')

array with previous media gallery: {{ load_gallery_prev(2) }}

- load_gallery_next($currentGalleryId, $thumbnailStyle = 'thumbnail')

array with next media media: {{ load_gallery_next(1) }}

- load_gallery_thumbs($galleryId, $thumbnailStyle = 'thumbnail')

array with images from gallery: {{ load_gallery_thumbs(5) }}


Filters

- naked_field

return rendered field, for example from view, without developers suggestions (<!-- Hook: etc --->), without HTML tags like <a href="xy">your_filed</a>. Just naked string what you can use as class, data attribute or in twig condition! Using example: {% set badge = content.field_show_badge|naked_field %}

- max_length($max = 0, $dots = true)

Check string length and return him summary or in original. It is pretty alternative to ugly {{ teaser_text|length > 90 ? teaser_text|slice(0, 90) ~ ' ...' : teaser_text }}. By second parameter you can disable adding "..." to the end of string.

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].