Skip to content

Instantly share code, notes, and snippets.

View arturu's full-sized avatar
🎵

Pietro Arturo Panetta arturu

🎵
View GitHub Profile

Drupal 8 Twig cheatsheet

Getting Drupal 8 field values in Twig

Image path: {{ file_url(content.field_name['#items'].entity.uri.value) }}

Image title text: {{ node.field_name.title }}

Entity Reference path: {{ content.field_tags[0]['#url'] }}

@arturu
arturu / drupal.theme.html.twig.md
Last active November 23, 2019 14:32
Drupal Twig

== Merge class to link item.link|merge({ '#options': { 'attributes': { 'class' : [ 'class1','class2','class3' ] } } })

@arturu
arturu / da_tip.txt
Last active October 25, 2019 09:19
Directadmin Tip
=== Versioni impostate sui domini
cd /usr/local/directadmin/data/users/ && cat */domains/*.conf | grep php1_select=
@arturu
arturu / paragraph--default.html.twig
Created February 2, 2019 09:48
Drupal 8 Template for Paragraphs customized for Width and Background color fields.
{#
/**
* @file
* Default theme implementation to display a paragraph.
*
* Available variables:
* - paragraph: Full paragraph entity.
* - id: The paragraph ID.
* - bundle: The type of the paragraph, for example, "image" or "text".
* - authorid: The user ID of the paragraph author.
@arturu
arturu / paragraph--carousel.html.twig
Created February 2, 2019 09:46 — forked from thejimbirch/paragraph--carousel.html.twig
Drupal 8 Template for Bootstrap Paragraphs customized for Carousel.