LN Webworks: Drupal Coding Standards with Git Hooks: All You Need To Know

Image removed.

Think of good code like a well-put-together puzzle—it's strong, looks good, and is easy to tweak. When you're coding with a team or diving into projects like Drupal, sticking to coding standards is a big deal. That's where Git Hooks come in! 

Git Hooks provides a simple and automated way to guarantee that your code consistently adheres to Drupal’s coding standards. By incorporating Drupal Coding Standards with Git Hooks, developers can effortlessly commit and push code that aligns with the community's guidelines. 

Let’s dive deeper into the world of Git Hooks to understand how they work and put them into action for smoother and more standardized coding practices.

The Significance of Drupal Coding Standards

Drupal's coding standards encompass a set of guidelines for writing consistent, well-structured, and maintainable code. These standards cover various aspects of code development, including:

Four Kitchens: Now’s the time to plan your migration to Drupal 10

Image removed.

Laura Johnson

Senior Engineer

Primarily a backend developer, Laura also loves adding new cross-disciplinary skills to her collection, such as working with themes and frontend frameworks.

January 1, 1970

If your organization is still using Drupal 7 or later, migrating to an up-to-date platform for your website has been looming like a weight on your shoulders. The move to Drupal 10 isn’t easy. It requires a migration of your site and a full redesign to take advantage of the new tools the latest version offers.

Not only do you need someone to write that migration, but you also need to secure the budget to undertake a project like this. As you wait for the right time to get started, the weight of the deadline to begin your migration to Drupal 10 has only grown heavier. After multiple extensions, the Drupal community has set January 5, 2025 as the final end-of-life date for Drupal 7.

What does that mean for your organization? On the one hand, you now have just over a year to start planning a migration before your site loses crucial support. But on the other hand, as many organizations like yours face a similar deadline, you can’t afford to wait much longer. The time to make the move to Drupal 10 is now.

Why you need to start planning for a Drupal 10 migration

If you’ve fallen behind in migrating your site from Drupal 7, you’re not alone. According to the Drupal community, more than 350,000 projects still use that version of the platform as of November 2023 — one-quarter of all Drupal sites.

As a result, you aren’t just facing a hard deadline to relaunch your new site as January 2025 grows closer. You’re also competing with a vast number of organizations just like yours who need to coordinate the same migration with a web development agency partner. Given that it takes an average of six months to complete the sales process to get started on a Drupal 7 migration, you’re already at risk of missing the deadline if you have not yet contacted an agency.

The longer you wait, the less likely you are to find a team with availability to work with you on a migration plan and website redesign before Drupal 7 reaches end-of-life. And, given the stakes involved, your organization can’t afford the risks of sticking on a platform without the vital benefits of ongoing support.

What your organization loses when Drupal 7 reaches end-of-life

Drupal 7 will reach its end of life 14 years after its initial release. If you’re still on the platform, your website will remain accessible after January 5, 2025. However, it will no longer receive feature updates, bug fixes, or security releases from the Drupal community.

This last detail is most critical to your organization. Any security issues discovered after January 2025 may be publicly disclosed, but Drupal will no longer provide any necessary updates. Prior to the announcement of this final extension for Drupal 7, your organization had the option of paying for extended support. But that is no longer the case.

When you work with the right agency partner, you can create a migration plan that will keep your website secure. Fortunately, your organization will be able to better manage ‌site security after the migration is complete. But that’s just one of the advantages made possible by getting your organization started with Drupal 10.

Drupal 10 offers dramatic advantages after migration

Trusting your site with the legacy code of Drupal 7 doesn’t just expose your organization to poor security. It prevents you from taking advantage of dramatic improvements for your site’s users and content editors.

Improved website speed and SEO performance

Fundamentally, your Drupal 10 website will run faster. Dynamic caching reduces page load times by invalidating only the content that has changed. Instead of needing to reload your entire page after a set amount of time, your cache can just reload the block with new information.

Drupal 10 also marks the end of Drupal 7’s jQuery. A large JavaScript library, jQuery was a powerful tool, but modern browsers perform many of the same functions. The up-to-date JavaScript used by Drupal 10 also decreases page load times.

Drupal 10 also supports new formats such as schema.org, Open Graph, and JSON-LD, which increase conversions from search engines. Plus, Drupal 10 supports advanced accessibility features that improve WCAG compliance and further improve SEO rankings.

Better site security and reduced maintenance costs

Drupal 10 improves your site security by including up-to-date protocols and dependencies such as PHP 8, Symfony 6, and CKEditor 5. As earlier versions of these dependencies reach end-of-life, they may be exposed to unpatched security vulnerabilities. Migrating to Drupal 10 avoids delays in getting critical security patches applied to your site.

One of Drupal’s major advantages as an open-source platform is the community’s Security Team, which delivers security advisories and provides guidance to contributed module maintainers on how to resolve potential vulnerabilities. Providing continued support from the community Security Team for all of your site’s contributed modules beyond the upgrade deadline is critical.

Improved content editing experience and efficiency

Drupal’s out-of-the-box CMS experience has always been limited. With Drupal 10, your site editors benefit from the Claro theme, which makes Drupal much easier to use. New image tools and an updated media library also enable better organization of your site’s assets.

Drupal 10 also includes the JavaScript text editor CKEditor 5, which further simplifies content creation and its accessibility. In addition, the platform offers enhanced translation capabilities in multiple languages, which enables your organization to reach a wider audience than ever.

Don’t wait until an emergency before moving to Drupal 10

Upgrading your site from Drupal 7 to Drupal 10 isn’t quick or easy. That’s why so many organizations like yours have been putting off the migration. But the sooner you start preparing your site for the future, the sooner you can take advantage of all Drupal 10 has to offer.

Better still, you gain the added peace of mind knowing your site won’t be exposed to critical vulnerabilities. And you don’t have to start planning on your own. With the right team of Drupal experts, you can make a plan to ensure your site remains stable and secure moving forward.

If this sounds like a plan that will help your organization move forward, we should talk.

The post Now’s the time to plan your migration to Drupal 10 appeared first on Four Kitchens.

cyberschorsch.dev: Elevating Drupal's Capabilities with Redis for Advanced Data Management

Most Drupal installations are using Mysql / MariaDB or Postgres for their data storage which allows Drupal to offer versatile and flexible ways of modeling content, especially building relationships with different content model, i.e. a blog post and a vocabulary with tags. In this blog post I will show you how to use Redis with Drupal for other things besides caching.

LostCarPark Drupal Blog: Drupal Advent Calendar day 6 - Smart Trim

Drupal Advent Calendar day 6 - Smart Trim james Wed, 12/06/2023 - 07:00 Image removed.

Welcome back to day 6 of the Drupal Advent calendar. Behind today’s door is the Smart Trim module, and here’s Mark Casias (markie) to tell us all about it.

Smart Trim allows you to control the length of your content by trimming it intelligently. It is designed to be a focused, lightweight improvement over Drupal core’s current formatter trimming capabilities. The maintainers’ focus is stability and ease-of-use. Customizations to the module are encouraged with template overrides and Smart Trim hook implementations.

After installing and enabling Smart Trim, you will see a “Smart trimmed” option in…

Tags

DrupalEasy: Using DrupalPod for core and contrib development

Image removed.DrupalPod is a browser extension and GitPod configuration that allows Drupal contributors to quickly and easily spin up a personal development environment in their browser without pre-installing anything.

Before we go any further, let's break down some of these concepts a bit more…

GitPod is a cloud development platform - meaning that everything necessary for development is installed in the cloud and the only thing that needs to be installed on one's local machine is a modern web browser. Developers can customize their cloud development environments virtually any way they see fit depending on the nature of their project. GitPod cloud development environments are sometimes called personal development environments, as they are normally created as an alternative to a developer's local development environment.

While GitPod environments will sleep after 30 minutes of inactivity, their current state will not be deleted for 2 weeks (and when pinned, will never be deleted) and can be re-launched via the GitPod Workspaces page

GitPod is a freemium software-as-a-service with a free tier that includes 50 hours/month of usage. 

DrupalPod has two main components - a browser extension (for Firefox and Chrome only) and a set of configuration scripts that customizes a GitPod personal development environment for Drupal core and contributed project (modules, themes, etc…) development.

The DrupalPod browser extension provides a quick way for a Drupal contributor to launch a new personal development environment on GitPod from virtually any Drupal issue queue issue. 

Image removed.

The DrupalPod configuration scripts for GitPod include just about everything a modern Drupal development environment needs, including the drupal/core-dev dependencies (which includes PhpStan, phpcs, and PhpUnit), a complete DDEV-based environment, Xdebug setup out of the box, and a useful tool to help set up a temporary ssh keys for using Git to push changes back to issue forks on Drupal.org in a secure manner.

In addition, every DrupalPod environment includes Drush as well as the Admin Toolbar and Devel modules - all with the idea of making it as easy as possible to focus on the task at hand.

DrupalPod was created and is maintained by Ofer Shaal, who also reviewed this blog post and provided answers to my many questions. Thanks, Ofer!

It is important to emphasize that DrupalPod can completely replace one's local development environment for core and contrib development. 

 

Who is DrupalPod for?

DrupalPod is not just for Drupal contributors who write and commit code changes. It also (and possibly more-importantly) allows non-coders to get more involved in the contribution process by making it easy for them to perform common issue queue tasks like testing merge requests (or patches) and reproducing reported issues. It can also be used for user experience and accessibility reviews, among other tasks. 

 

Getting started

There's a few steps that are required before launching a Drupal issue queue merge request in DrupalPod. Luckily, both are relatively straight-forward:

  1. Install the DrupalPod browser extension in either Firefox or Chrome.  Be sure to use the same browser for the remainder of the steps outlined in this article.
  2. Create a (free) GitPod account and log yourself in through Github. 
  3. Login to your Drupal.org user account.
Image removed.

Note that if you're not interested in making code changes to an existing issue, then the steps marked with an asterisk (*) can be skipped.

 

Launching a development environment

Next, find an issue on Drupal.org that you'd like to work on. If you're planning on making a commit and pushing it back to the issue fork, be sure to click the green "Get push access" button near the top of the issue.

Image removed.

I've created a test issue in the Markdown Easy module issue queue with an issue fork if you'd like to test DrupalPod on an inert issue. The rest of this article will assume you're testing with this issue.

In your browser, click on the DrupalPod browser extension and you should see the interface shown in the screenshot earlier in this article. You'll see that the project (Markdown Easy) and the issue fork for this issue ("markdown_easy-3403460") are pre-selected. Select the "3403460-drupalpod-test-issue" branch, "10.0.9" for the Drupal core version, and "Standard" for the install profile. Since this issue only contains an issue fork and no patches, the "Choose a patch" dropdown can be left blank.

It should be noted that the options for "Drupal core version" are not automatically updated whenever a new version of Drupal core is released, and there may be a delay before the DrupalPod browser extension is updated with the most recent version of Drupal core as an option. 

Image removed.

Then, click on the "Open Dev Env" button and accept the default GitPod configuration settings by clicking the "Continue" button on the GitPod configuration page. By default, GitPod will launch an in-browser version of Visual Studio Code.

Image removed.

Next, GitPod builds your personal development environment using the configuration provided by DrupalPod - depending on several factors, the process to create the environment normally takes just a few minutes. Keep an eye on the terminal output in the Visual Studio Code interface to see when it completes.

Image removed.GitPod is still setting things up.

 

Image removed.GitPod is ready to go.

Another big sign that your personal GitPod development environment is ready is when a web browser opens in the Visual Studio Code interface on the development environment's version of Drupal!

Image removed.

 

To login into Drupal in the GitPod-powered personal development environment use the credentials:

  • Username: admin
  • Password: admin

 

What happens if the project doesn't start up cleanly in GitPod?

A fairly common occurrence (especially when working with older issues) is that during the DrupalPod/GitPod setup phase, a Composer error occurs. This is normally not an issue with DrupalPod, but rather with the issue fork (or patch) being out-of-date and in need of update. 

 

Setting up ssh keys for pushing Git commits

This step is not necessary for those just looking to test patches or merge requests and not make code commits.

Hopefully, improved integration between DrupalPod, GitPod, and git.drupalcode.org will soon render this manual temporary ssh key setup obsolete.

At the current time, in order to push commits from a GitPod personal development environment back to a Drupal.org issue fork, a temporary ssh key pair must be set up. While DrupalPod does an admirable job of trying to streamline the issue, there are still a couple of manual steps involved and the process isn't super-smooth.

Luckily, the process is outlined in the "Contribution Guide" document that automatically opens in a DrupalPod environment (see previous screenshot). Step 5 of this guide instructs the user to run a script in the terminal in order to kick off the process of creating the temporary ssh key pair. Currently, the script launches a pseudo-GUI in the terminal app, which leads to the instructions-template.md file being displayed with the necessary steps.

Image removed.

At this point, it is important to click on "< OK >" in the "If you completed the instructions above - click OK" box. 

Image removed.

Note that this will kick off a command line task that requires your input, requesting you to enter your desired passphrase for your temporary ssh key (I normally just hit "Return" to leave the passphrase blank). Only once this is step complete will you see your new, temporary ssh public key appended to the instructions-template.md document. After this, proceed with steps 1-9 listed in the document.

Once complete, click to < Exit > the pseudo-GUI in the terminal app, then complete step 10 to confirm that the temporary ssh key is working as expected. I have found that the resulting message is semi-clear at best, but as long as you see "Setup was successful" somewhere in the message, you're probably good-to-go.

Image removed.

At this point, I normally close the ssh-related .md documents open in Visual Studio Code and get to work. 

 

Using Git from inside a DrupalPod environment

One aspect of using DrupalPod that is quite important for anyone interested in code contribution is understanding at least a little bit about how the code base is organized.

Here's the short version - the directory that you should pay the most attention to is repos. This is where the project of interest (the one whose issue fork or patch you're working on) is available to you for editing and (more importantly) for performing Git operations on. DrupalPod uses symlinks to ensure everything is running smoothly, and the repos directory is automatically symlinked to the project of interest (regardless if it is a module, theme, or Drupal core).

When DrupalPod is opened for a Drupal core issue, https://github.com/joachim-n/drupal-core-development-project is used for the code base.

Image removed.

Inside the repos directory is the project of interest. To modify a project file, navigate to the file inside the repos directory. If/when you're ready to make a code commit to the issue fork, you may use the Visual Studio Code's Git GUI or the command line (after navigating to the project inside the repos directory.)

Assuming that you properly set up a temporary ssh keypair from the previous section, you should be able to perform a git push from either interface. 

Image removed.

The use of the repos directory is the same regardless of if you're working on a contributed module or Drupal core - the project of interest is in the repos directory.

As a matter of practice, once the GitPod environment is up-and-running, the first thing I do is navigate to the repos/ directory on the command line.

 

Code quality tools

While Drupal's core-dev dependencies are automatically provided in all DrupalPod configurations, they do not work out-of-the box without some configuration (much like as if you installed them yourself in a local development environment.) Setting up code quality tools like phpcs, PhpStan, and PhpUnit for core or contributed modules involves a little bit of configuration that is out-of-scope of this article. More information is available on drupal.org - this material (and much more) is also covered in DrupalEasy's 15-week Professional Module Development course

 

What's next for DrupalPod?

Based on conversations with Ofer Shaal, the primary maintainer of DrupalPod, users can expect the following improvements in the coming months:

Tag1 Consulting: A Guide to Estimating Migrations - How Much Will My Drupal Migration Cost? Part 3/3

Hosted by Michael Meyers, - Managing Director of Tag1 Consulting, and Janez Urevc, Sr. Engineer at Tag 1. This podcast series focuses on the strategies involved in upgrading and migrating Drupal websites and applications. This is the last episode in a mini series in which we aim to answer the common question: “How much will my migration cost?” Spoiler alert: It’s complicated. We team up with Lucas Hedding one more time to help demystify the complexities of estimating your project, delving into unexpected variables that could shake up your budget and reveal why quality assurance is more than just a checkbox. Part 1 | Part 2 | Part 3 Please let us know if you have specific migration-related topics you'd like to see us cover. Or, reach out and let us know if we can be an active part of ensuring your migration is a success! --- For a transcript of this video, see A Guide to Estimating Migrations - How much will my Drupal Migration Cost? - Part 3/3. --- Photo by Julia Craice on Unsplash

Read more michaelemeyers Tue, 12/05/2023 - 06:29

Specbee: Beastify Your Brand: 5 Game-Changing Marketing Tips Inspired By Mr. Beast

When your kid's begging for a Feastables bar just because Mr. Beast is on the label, you gotta hand it to the genius marketing. If you’re not in the loop (or you don’t have an 8+ year-old in tow), Mr. Beast is an award-winning YouTube legend and a new-breed philanthropist boasting over two hundred million subscribers. He started with humble, low-budget playthrough Minecraft videos, and fast forward, he spends more than a million dollars on creating his videos, including philanthropic giveaways. Yep, we’re diving into Mr. Beast today and how this marketing maestro is an inspiration for marketers like me to create better content. He's like the marketing guru you didn't know you needed. If you’re a Marketer, Business owner, or just aiming to improve your personal brand, check out the rest of this article for 5 actionable marketing techniques you can implement right away. Mr. Beast in a Nutshell, By the Numbers The 25-year-young James Donaldson (a.k.a Mr. Beast) kicked off his video journey at just 13 in 2012. He has a whopping 768 videos on his main Mr. Beast YouTube channel (he has 4 more). His first viral video was in 2017 where he counted to 100,000. Now he’s leading a crew of 250+ and managing 5 successful channels on YouTube. He’s won every Creator of the Year award every year since 2020. Not just a hit with adult audiences, his popularity among kids led to back-to-back wins at the Nickelodeon Kids' Choice Awards in 2022 and 2023. Teaming up with renowned YouTuber and inventor Mark Rober, Mr. Beast spearheaded a campaign (Team Trees) to plant 20 million trees by 2020. The result? Over 20 million trees planted! For his creative endeavors, he invested a cool $10 million in his new 100-acre indoor studio He spent around $4 million on creating his most expensive video, the Squid Game recreation video (sans the violence) which garnered a staggering 500 million+ views. 5 Lessons Mr. Beast Can Teach You About Marketing You might not be playing with a million-dollar marketing budget, but by closely examining Mr. Beast's strategies (and a fair share of interviews), there are valuable lessons for every marketing professional. Though Mr. Beast's marketing focus centers around YouTube videos, the takeaways extend beyond it.    1. Become obsessed with your content  Mr. Beast reveals in his interviews that he was so obsessed with creating content and getting new ideas that he would literally force himself to dream about it and wake up in the middle of the night writing down ideas. While that might not be ideal for everyone, obsessing about the kind of content you want to push out there is crucial. Get really into it. Write down (or record) ideas on the fly, no matter where you are! Your focus should be on creating phenomenal, valuable, and entertaining content instead of worrying about how many subscribers/ viewers/ conversions you want to get out of it. As marketers, prioritizing value in our campaigns ensures a lasting impression and fosters brand loyalty. Let the quality speak louder than the numbers.    2. Create content that the world is obsessed with Staying on top of the trends has never been more important. One of the reasons behind the sensational success of Mr. Beast’s amazing Squid Game Recreation video was its timely release, just a couple of months after the Squid Game show hit Netflix. Now it has over 500 million views! The key is creating content that resonates not just with your brand but with the world around you.  These days everyone is jumping on the “AI” or the “ChatGPT” bandwagon and they are yielding results! Most marketing teams at B2B or even B2C companies work on a process. I loved what Kipp Bodnar, CMO at Hubspot, said in one of his videos - “Process kills creativity”. By the time the process is over, the trend may have passed. That’s why marketing teams should occasionally break free from the process mentality, take calculated risks, and seize opportunities to create trending content when the time is right.    3. Hook your audience from the get-go In the words of Mr. Beast, “Do not undervalue the first 10 seconds!”. His videos are so captivating that within the first 15-20 seconds, you know you want to keep watching. He lays out the concept of the video, gives you everything that you need, AND ensures it is super short, concise, and intriguing. He admitted that he spends a LOT of time on the openings because that’s the first impression and you gotta make it last. And that my friends, is what gives him about a 70% retention rate for most of his videos! This principle can be applied to any medium of marketing to help improve retention, be it blogs, videos, social media, newsletters, or emails. Write attention-grabbing headlines but before that, invest a lot of research time. It helps if they’re simple, relatable, and concise. Incorporating numbers to your headlines or titles is a big YES. Most of Mr. Beast’s successful videos have them:   “I spent 7 Days Buried Alive (new)” “I built 100 Wells in Africa”  “$456,000 Squid Game in Real Life”     4. Diversify Your Content Mr. Beast's diverse content strategy is a key factor behind his massive success. Not only does he have 5 different channels on YouTube, but his content variety is vast. Mr. Beast ensures there's something for everyone in his audience. Some of his content types include: Let’s Play: Playthrough videos of Minecraft (that game's a best-seller now) with running commentary and fun banter. Best and Worst YouTube Intro Videos: A quirky take on intros. Stunt Videos: Where he challenges himself with fun and sometimes dangerous stunts Junklord Videos - Creative use of copious amounts of a product in unconventional ways. Philanthropy Videos - Giving away a LOT of money to help out someone or just random strangers for completing super easy tasks Reaction Videos - Documenting their reactions to trending videos        By diversifying your content strategy, you'll be able to reach a broader audience. You will also increase the likelihood of keeping your audience hooked and engaged. Additionally, it creates multiple touchpoints for your business.. Content resonates when it strikes the right person at the right time. When you have a varied content portfolio, you can be assured that more potential customers encounter and connect with your content.    5. Be Unique In his interviews, Mr. Beast candidly recalls being labeled a 'freak' for his early obsession with YouTube and content creation when it wasn't as popular. He has made videos that nobody has done before or even copied them today. From seemingly mundane concepts like “Counting to 100,000” (first viral video), “Spent 50 hours in solitary confinement”, “Watching paint dry”, or “Reading every word in the Dictionary”, Mr. Beast consistently defied norms. He also did a “Hi me in 5 years” video that he shot in 2015 but released only in 2020 where he talks to his future self. You can even hear him say “If I don't have a million subscribers by the time you’re watching this, my entire life has been a failure”. Well, we all know how that turned out! 🙂 But how do you ensure your content stands out? How do you generate these offbeat ideas? It is easier said than done. But here are a few tips inspired by Mr. Beast that can help you out: Jot down all your quirky ideas, no matter how crazy they may seem.   Bounce off ideas with your colleagues, team, or people around you and get feedback   Prioritize continuous learning by exploring diverse content for inspiration across various genres and channels.   Start your brainstorming sessions right after consuming something that sparks inspiration.   Be ready to experiment, fail and experiment again. It took Mr. Beast nearly 4-5 years of consistent experimentation and failed videos before striking gold with his first viral hit.   As discussed in the previous point, latch on to trends, learn from them, and infuse your unique perspective. Being different is a journey, and sometimes the most extraordinary ideas emerge from the seemingly mundane. Oh, and can we talk about Mr. Beast's Feastables? They’re pure indulgence. And no, this is NOT a sponsored post.   Final Thoughts For me, the whole process of watching Mr. Beast’s videos and interviews felt like a crash course in marketing. This article also serves as my reminder to put these techniques into practice. I hope you found it as enjoyable to read as it was for me to write. On a completely different note, we’re a fine Drupal development company and we build fantastic Drupal websites for our clients. Take a look at some of our past work before you call us at +1-678-806-8004. Let's build something extraordinary together!