How to add block regions in a Drupal theme
To add additional block regions in a Drupal theme you need add the new regions to the following files. In this example I am adding four blocks side by side 25% width just above the content block. As I am using a Bootstrap theme, I have wrapped them in the div col-sm-3.
theme.info.yml - you define them in this info file in this format:
Are you using composer to manage your website dependencies?
Are you using composer to manage your website dependencies? The answer to this question should be definitely yes! I work with many website designers and developers throughout the UK and it still amazes me that so many are not using composer to manage the code in their websites. I believe any web developer using open source content managed systems like Wordpress or Drupal, using composer to manage and update your sites core files and contributed modules and themes is a no brainer!
How to add Drupal Commerce variation image field to metatag
To add the og:image meta data tag for Drupal commerce variation products images, use the following token:
[commerce_product:variations:0:entity:field_image:entity:url]
I tried many variants including [commerce_product_variation:field_image] which can be found at admin/help/token under the product variation section. This you would think would work but it didn't! After a lot of time trying different token variants, the only one that seems to work is:
[commerce_product:variations:0:entity:field_image:entity:url]
*UPDATE
Need your Drupal website updated?
I have tons of experience in migrating. upgrading and updating Drupal core and modules. I have been doing this sinse the days of Drupal 5x. If you have a Drupal 5x, 6x, 7x, 8x or 9x site and it requires updating, contact me here.
How to fix Drupal CAPTCHA ReCaptcha validation error: unknown CAPTCHA session ID
Edit the recaptcha.module file inside the ReCaptcha module (usually in: modules/recaptcha) and change this code:
// As the validate callback does not depend on sid or solution, this // captcha type can be displayed on cached pages. $captcha['cacheable'] = TRUE;
To this code:
// As the validate callback does not depend on sid or solution, this // captcha type can be displayed on cached pages. //$captcha['cacheable'] = TRUE; $captcha['cacheable'] = FALSE; \Drupal::service('page_cache_kill_switch')->trigger();
How to install more than one Drupal module at a time
/opt/plesk/php/7.4/bin/php /usr/lib64/plesk-9.0/composer.phar require drupal/ctools drupal/content_access drupal/disable_messages drupal/libraries drupal/masquerade drupal/page_manager drupal/metatag drupal/pathauto drupal/redirect drupal/panels drupal/token drupal/webform:^6.0 drupal/xmlsitemap
Geo Location for your local trades website
As a trades person, you will be trying to target your local geographical area to gain more referrals through your website. There are many SEO implementations that you should have in your website to ensure that you are getting the right sort of traffic from the right location. One of these that will help you rank better is to make sure you implement geo location tagging metadata on every page of your website. This isn't seen by visitors to your website but it is seen by search engines like Google and is used in location based searches.
Please use mysql_upgrade to fix this error - Plesk fix
A Drupal 8/9 module I plan to use
The following modules I plan to use in the near future so that every time one of my clients log into their website, I can redirect them automatically to a page where I can give them up to date helpful advice and information on how to use their website and recommendations on what they should be doing.
https://www.drupal.org/project/redirect_after_login
https://www.drupal.org/project/vapn