How to set a menu link attribute programmatically
Menu Link Attributes is a great Drupal 8 and 9 module that allows you to add attributes to your menu links. Let's see how you can set the attributes programmatically.
Menu Link Attributes is a great Drupal 8 and 9 module that allows you to add attributes to your menu links. Let's see how you can set the attributes programmatically.
Composer is a great tool for Drupal and in general PHP developers, but in some cases, it might take some effort to accomplish what you want. I tried to install Drupal 9 (dev version) and Drush 10 today and here's what I had to do to make it work.
At the moment I'm a maintainer or co-maintainer of 22 Drupal projects. Only two of them are Drupal 7 modules, the rest are Drupal 8 modules. My plan for those 20 modules is to make them Drupal 9 ready by June 3, 2020, which is the date when Drupal 9 should be released.
Drupal 9 is coming soon, more precisely, on June 3, 2020. I prepared a simple checklist for you so that you can take steps right now to make the upgrade easy and painless.
SVG Formatter is a Drupal 8 and 9 module that provides support for using SVG images on your website.
Entity API is a great module that extends the entity API of Drupal core. One feature that I particularly like is the entity query access API. You can use it to alter entity queries and views, to only list the entities that the user has access to.
Find out how to alter Inline Entity Form widget columns.
Performing operations in an update hook that you know will take a lot of time or require a lot of processing power should be done in a batch job.
Quick tip on how to programmatically update a search index.
Menu link defined statically in a *.links.menu.yml file can be altered with hook menu links discovered alter hook, but if you want to provide a dynamic value you have to use something else.