php

Articles about php

Drupal 8 and hook form alter: How to check if taxonomy term is new or old?

Oct
2020
08
If you want to check with hook_form_alter if the taxonomy term is new or updated (old) you can't use the form_id or the $form_state->getFormObject()->getOperation() because it always returns "default". The solution for this is : $form_state->getFormObject()->getEntity()->isNew() So for example:

How to disable a block programmaticaly with drupal 8

Aug
2020
11
On my custom theme i have a region with 2 blocks. It is an event region block. The first block is a header block and the second block is a view block that renders the active - running events. However when there are no events the view result is an empty result so nothing is rendered but the header events block remains there.

Configuring your Local Drupal 8 Development Environment

Jun
2020
22

Coming from drupal 7 optimizing drupal 8-9 for local development is a struggle especially if you want to properly optimize your local environment in terms of enabling debugging and disabling cache for a while. The steps are not a lot but there are some "tricky" settings for having a constant local workflow.

Pages

Subscribe to RSS - php
this is an arrow pointing back to the top of the page