Weblog aka "Blog"

Before our modifications to the IEF table

Snippet: Drupal 8 Commerce: Show SKU in product variation inline entity form table

23.10.2018 - 08:27

Today I'd like to share a little snippet with you on how to add or remove fields from the inline entity form line items table in a product edit form.

By default that inline entity form table contains

  • Weight
  • Product...

Use (jquery.)photoswipe as lightbox etc. alternative with link fallback

11.10.2018 - 08:48

Today I'd like to share a very simple trick which seems a bit underrepresentated in the documentation of jquery.photoswipe (built on Photoswipe): How...

Open Drupal 8 Webform in Modal

24.09.2018 - 09:46

Creating a webform modal is quite simple and straight forward in Drupal 8.

We only need the Webform module and some classes for the modal opening button:

  1. Download and...

Drupal 8: Load current entity from controller dynamically *updated*

29.08.2018 - 11:08

Today I'd like to discuss a little Drupal 8 snippet to dynamically load an entity from the controller by the current path.

This acts a bit like a Drupal 8 replacement for Drupal 7's...

Drupal 8 Webform: Prepopulate entity reference (select, radio, ...) with current entitiy / node ID via tokens

03.08.2018 - 10:13

Several times in the last months we had the requirement to prepopulate a Drupal 8 webform with a parent entity ID from the URL. For example we had forms to register for events which we embedded on the node page as paragraphs or blocks and wanted...

VSCode (Visual Studio code) mark dollar sign $ on double click

24.07.2018 - 18:20

Visual Studio Code is my new IDE love. It's simple, lightweight but brings great functionality.

One little problem was that when double-clicking a variable with a dollar-sighn ("$") (for example in PHP or JavaScript) not the whole $...

Drupal 8 views set exposed filter (default) programatically with auto-submit

27.06.2018 - 17:00

Setting a dynamic views exposed filter can be done via hook_form_FORM_ID_alter() regularly if it's just a prepopulation of the views exposed filter form.

But if you wish to immediately run the filters using better_exposed_filters auto-...

Drupal, Drupal 8, View

Snippet: Drupal 8 Commerce: Product variation assign in DB

20.03.2018 - 10:20

Short snippet to restore product variation assignments (references) in Drupal 8 Commerce after an SQL error has occured on product save, which left product variations orphaned.

Fix all product variation relationships having no...

Drupal 8 Field Type Schema column add / change / delete HOOK_update

14.02.2018 - 18:04

As heavily discucced in this years old issue: [#937442] there isn't a good solution or helper in Drupal core currently to change the schema of a custom field.

Modules like

  • field_collection
  • dynamic_entity_reference (#...

Drupal 7 Snippet: Photoswipe: Only output first image of image field, but show the rest in swipe gallery

15.12.2017 - 14:20

Simple snippet to only output the first image of an imagefield in a view and show the rest of the gallery in the photoswipe overlay.

Hint: Don't forget to add the photoswipe-gallery class on the field wrapper in views settings:...

Syndicate content