Skip to content

Instantly share code, notes, and snippets.

View GuitarKat's full-sized avatar

Kathleen V GuitarKat

View GitHub Profile
@maxjwe
maxjwe / swatch-renderer.js
Last active February 2, 2022 19:32
Select swatch when page is loaded - Magento 2
_RenderControls: function () {
var $widget = this,
container = this.element,
classes = this.options.classes,
chooseText = this.options.jsonConfig.chooseText;
$widget.optionsMap = {};
$.each(this.options.jsonConfig.attributes, function () {
var item = this,
@raphaellarrinaga
raphaellarrinaga / drupal_8_twig_cheatsheet.md
Last active July 20, 2023 21:21
[Drupal 8 Twig cheatsheet] #tags: drupal8, twig, cheatsheet

Drupal 8 Twig cheatsheet

Please note I created that sheet as a personal side note/draft and not everything is fully tested. There could be errors or better things to do. So if you spot something wrong or something that can be improved, feel free to comment below and I will do the changes.

Getting Drupal 8 field values in Twig

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