How to rewrite jQuery Cookie, core/js-cookie library in Drupal with the js_cookie module
Why this change?
- In Drupal 9, jQuery Cookie was removed from core and replaced with the js-cookie library. A BC shim (
core/jquery.cookie) existed during Drupal 9 but was removed for Drupal 10.
Drupal Update
This section is about updating the Drupal core from previous versions (including legacy Drupal 6 and Drupal 7) to the latest stable release. I will also publish articles here on how to update contributed modules for Drupal.
Endless support for CKEditor 4 in Drupal
The Drupal CKEditor module is ending support for CKEditor 4. However, you still have the option to connect CKEditor 4 through custom modules and continue using it. Of course, using the new CKEditor 5 or later is preferable, but the legacy CKEditor module is still used by more than 140,000 sites (every fourth Drupal site!):
Using Chat GPT to rewrite javascript code without jQuery
Prompt for ChatGPT to Rewrite jQuery to JavaScript
If you want to rewrite jQuery code into pure JavaScript using ChatGPT, navigate to chat.openai.com and enter the following clear, concise prompt:
Please rewrite the following jQuery code into vanilla JavaScript, maintaining the same functionality. Ensure compatibility with modern JavaScript standards (ES6+). Also, include usage of Drupal.behaviors if applicable. [Paste your jQuery code here]
Drush shows error: Support bash to support 'source' with fallback on $0 if this does not run with bash
I have huge number of configs and run usually config import with php -d memory_limit=-1 (disable memory limit for PHP):
php -d memory_limit=-1 ./vendor/bin/drush config-import -y
But this time I got an error:
Additional materials for PHP lessons
This section will contain additional materials on the lessons, an introduction to php, various facts about php and something else.
Drupal Theming Lesson 7 Taxonomy Term Theming
In this tutorial we will theme the taxonomy page using the taxonomy-term.tpl.php template and the taxonomy views integrator (tvi) module.
Tools for creating a website
In this section, I will be sharing descriptions of the tools I use for website development: programs, extensions, plugins, goodies, fancy features, and more.
1.5. Choosing a hosting, purchasing a domain name. Transferring a site to a hosting.
You’ve already built your site and are ready to publish it online. To do that, you’ll need two things: a domain and hosting. When purchasing a domain and hosting, read the pricing plans carefully and ensure they support Drupal 8.
Purchasing a Domain Name
First, decide which domain zone to buy. Popular choices include:
Composer in Drupal 8. Displaying latest tweets from Twitter.
To install modules and libraries in Drupal, it is best to use Composer. Composer is a dependency manager that automatically installs required libraries when installing a module. Although Composer makes module installation slightly more complex, it simplifies managing external libraries since it downloads and connects them automatically.
To install Composer, go to the official site: