Planet Drupal

Subscribe to Planet Drupal feed
Drupal.org - aggregated feeds in category Planet Drupal
Updated: 21 hours 35 min ago

Promet Source: Web Accessibility Solutions or Whack-a-Mole

3 June 2019 - 1:44pm
Smart business decisions tend to be equated with cutting costs and saving money.   Over the past decade or so, “Better! Faster! Cheaper!” has become the rallying cry for business process reengineering and new initiatives within every sector. As a developer and former business owner, I get this. Efficiency is essential.  
Categories: Drupal

Mediacurrent: Can I See the Menu Please? Building and Integrating a Menu in Drupal

3 June 2019 - 10:27am

By nature, menus are complicated. They’re not easy to work with, build or style, and yet they are probably the single most important navigation element of any website. Despite their complication, they need to be perfect to serve their purpose. A menu can make or break a website. They can make your browsing experience a pleasant one, or can drive you to leave a website frustrated and likely never to return.

When it comes to menus and forms, it is best to let Drupal dictate the direction rather than build them independently of Drupal. By adhering to Drupal’s best practices we can save a lot of time, effort and frustration. For example, rather than writing your menu’s markup before you see it being printed by Drupal, it is best to build your menu in Drupal and see what the markup looks like. Then you can use Drupal’s markup as a starting point for writing your menu’s markup. 

This is going to be a lengthy post (mostly because it includes a lot of code snippets), but this article will cover all you need to accomplish the following:

Build a multi-level menu component in Pattern Lab

Let’s start by building a pretty straight forward multi-level menu component in Pattern Lab. If you’ve used Pattern Lab or KSS Node you know most components require at least three files: 

  • .twig for the component markup and logic,
  • .yml or json for the component data or dummy content
  • .css or scss for the component styles
  • In some cases you may also need a Javascript file
     

For more in-depth explanation on building and integrating components read our blog series.  
Note: This series is over two years old and many things have changed since then, but the basics of building a component still apply.

Building the component

If the code above does not look familiar to you it’s probably because you’ve never used a Twig Macro. I will explain the macro in detail shortly, but for now let’s move on to completing the component.

  1. In your theme’s components location create a new directory called main-menu
  2. In the main-menu directory, create the following three files:
    • main-menu.twig
    • main-menu.yml
    • main-menu.scss
  3. Inside main-menu.yml add the code below:
  4. The data above represents an array of items. Each item has 3 key/value pairs: Title, URL and menu_level.  Each item represents a link in the menu.  You may notice some of the links have nested arrays (i.e. below). These represent submenus in the menu tree. The items array above is only intended to simulate the menu’s data for our component. In Drupal the array will be provided when we add menu links to Drupal’s Main Menu.
  5. Inside main-menu.twig add the code below:
  6. Finally add the following styles in main-menu.scss

These styles are as bare as possible. They are simply to make the menu look presentable and could use a lot of improvements. This is what the multi-level menu looks like:

It’s important to note that the component will simply be used for styleguide purposes. We will create a similar component for Drupal, but we will use the original component above as a base for markup styles and behavior.

Why do we need to create a duplicate component for Drupal?

Drupal provides attributes Pattern Lab does not understand. Rather than over complicating the component, we are going to keep it simple for styleguide purposes while the Drupal version is more elaborate with all the things Drupal needs. This is not required but provides more clarity to the process.

Create a Twig template suggestion for the main menu

Our ultimate goal is to update Drupal’s menu system to render with similar markup as the main-menu component. This will require several steps which we will cover next.

Follow these steps to enable Twig Debugging in your theme. Then, you can inspect your site, which will allow you to see the various template suggestions that Drupal uses to render the page; including your navigation menu. The debug information looks like this:

Under File Name Suggestions notice two template names: menu.html.twig & main-menu.html.twig. The X next to menu.html.twig indicates Drupal is using this file to render the Main Menu. The second file, main-menu.html.twig, is what Drupal is suggesting we create if we only want to alter the Main Menu and not other menus.

Under Begin Output notice the path where menu.html.twig can be found, the example above is pointing to Drupal’s stable theme.

To ensure we only affect the main menu and not other menus on our site, we are going to make a copy of Drupal’s menu.html.twig in our theme and then override it. This is recommended rather than modifying Drupal core’s template. Let’s start:

  1. Copy the menu.html.twig template from core/themes/stable/templates/navigation/ into [site_root]/themes/custom/<your-theme>/templates/navigation/menu.html.twig (if these folders do not exist yet in your theme go ahead and create them).
    Following the golden rule “Never hack core”, we want to make a copy of Drupal’s menu template in our own theme. Replace the core theme’s name with your core base theme if you are not using stable.

  2. Next, In your theme rename the newly copied template to main-menu.html.twig.
    Copying menu.html.twig into our theme will affect other menus. This is why we are renaming the template so it only affects the main menu (main-menu.html.twig). Replace ‘main’ with whatever your menu’s machine name is if you are not using Drupal’s Main Menu. This can be found in Drupal’s Menus page (admin/structure/menus).

  3. After clearing Drupal’s cache, inspect the menu again and you should see the X next to main-menu.html.twig which means Drupal is now using our custom twig template suggestion to render the menu.

Create a multi-level menu in Drupal
  • Let’s make sure we have a menu we can see in Drupal. Let’s create a multi-level menu using the Main Navigation menu (Structure | Menus | Main Navigation).

  • Add as many links as you wish. Be sure to add nested items so we end up with a multi-level menu.

  • In addition, ensure each of the submenu’s parent links are set to “show expanded. You will see the option on the Add/Edit Link page.

  • Finally, go to Structure | Block Layout and click Configure next to Main Navigation

    • Change Number of levels to display to Unlimited. This will ensure dropdowns are rendered and display in your navigation.

Customize the template suggestion

Before we look at the code inside menu.html.twig as it may look confusing or not familiar, we are going to move it into the same directory as the main-menu component. We are doing this to make some improvements to the macro.

  1. In the same directory where you created the main-menu component, create a new file called _main-menu-macro.twig (notice the underscore as first character of file name). This file is only for Drupal purposes and we don’t need it to be shown in Pattern Lab. The underscore allows Pattern Lab to ignore it.

  2. Copy all the code from main-menu.html.twig into _main-menu-macro.twig.

The above code is a Twig Macro. Macros are the Twig version of functions. Just like you would write a function in PHP to do something and return something, you can use a Twig macro to generate some output.

Rendering menu with default macro

If we were to use the macro provided by Drupal as is our menu would render at its simplest form with minimum markup and almost no semantic css classes. See example:

The markup above may look different depending on your base menu. The classy base menu may show more markup but it does not make our job easier to style the menu.

Update Drupal’s menu macro to match our component’s markup

Not having the right markup for the menu, or any other element for that matter, can really complicate things for us when it’s time to style. We are going to modify the macro so it matches the markup of the main-menu component, and as a result the styles we wrote for the component will apply to the Drupal menu.

Menu Macro explained

Let’s step through this macro line by line to understand what it does. To keep things simple we are going to ignore all the custom classes we added above and focus on the macro itself.

  • Twig macros can be called from other twig templates; and it's also possible to place the macro within the same twig template from which you call it. The context is used in this case (line 21). So, with this import statement, we imported the macro and set it as a variable called menus.
  • Using the menus variable we then assign a name to it (main_menu), (line 23), which will take the following parameters: items, attributes, and 0). This name can be anything you wish.
  • Now we declare the macro again but this time with its new name, main_menu,( line 25), and pass the slightly modified parameters items, attributes, menu_level. We've changed the menu_level to a variable. If you are wondering where these parameters come from, the comments above the macro code in menu.html.twig provide all these variables.
  • Now that we’ve updated the arguments, we self import the macro again to make use of it (line 26).
  • Before writing any markup, we first check whether there are menu items to render (line 27).
    • If there are items in our main menu we start writing the markup. However, since we may have a multi-level menu, we want to make sure we identify the top level menu from nested (submenus), menus in the tree.  
    • This is where we first check if the menu_level is 0 (zero).
    • If it is the top level menu, we print a <ul> and we pass Drupal’s attributes in addition to our custom class.
    • If menu is not top level (submenus), then we simply print a <ul> with its corresponding class.

Learn more about Macros in Twig Templates.

Looping through the menu tree

Looping through the items array allows us to intersect each item and apply classes or attributes.

  • First we loop through the items array (line 33), and for each item, we print a <li> some classes which can be helpful if we need to style the different states of the menu.
  • For each link in a list item, we pass two things:
    • The node title
    • The node url
  • Inside the list item, we check to see if that particular item has other items or submenus.
  • When submenus exist, we make use of the macro again to repeat the process of printing the menu. This is where the macro saves us from writing duplicate code.
  • For each level of submenus we are increasing the menu_level by 1 and printing it as part of the submenu class. This is handy if we want to target a specific submenu in the tree.
  • Finally, we close all previously open actions/tags (i.e. for loops, if statements, lists, and macro).

RESOURCE: I recently ran into a blog post by Tamas Hajas where he has a great way to address classes and states on a menu. Check it out Drupal 8 Twig: add custom CSS classes to menus

Looking at the rendered menu after Macro improvements

Now that we have a better understanding on how the macro works, and after making the improvements discussed above, the markup for the menu would look something like this:

Integrate the Main Menu component with Drupal’s Menu

The last part of the process is to integrate all the work we’ve done with Drupal, so our Main Menu is rendered with the markup, styles and behavior we implemented when we built the component.  

  1. >In your editor, open [site_root]/themes/custom/<your-theme>/templates/navigation/main-menu.html.twig
  2. Delete all the content in the twig template except for the comments, and then paste the code below into it
{{ attach_library('your_theme/main-menu') }} {% import '@patterns/main-menu/_main-menu-macro.twig' as menus %} {{ menus.main_menu(items, attributes, 0) }}
  1. Clear Drupal’s cache
  2. Reload Drupal’s page

Since we moved the macro to the component’s location, all we need to do in the main-menu.html.twig template is to import the macro and provide the parameters the macro expects. These parameters can be found in the twig template’s comments.

If we did our job right, Drupal’s menu should now look and behave the same way as our component. In addition, if you inspect the Drupal page, the menu should reflect the same markup as the main-menu component.

IMPORTANT: If you are using the Main Navigation blog to position the navigation where you want it in the page, you may need to make a copy of the twig template for that block in order to assign the main-menu class the menu needs.  

  • Copy block--system-menu-block.html from your base theme into your own theme’s /templates directory
  • Modify the template so it includes the main-menu class, as shown below:
    <nav class="main-menu" role="navigation" aria-labelledby="{{ heading_id }}"{{ attributes|without('role', 'aria-labelledby') }}>
Drupal Libraries

As a best practice, we should create a drupal library to attach any styles and javascript to our component. See this article for adding CSS and JS to a page or component.

In our case our library would look like this:

  • Inside /themes/custom/<your-theme>/your-theme.libraries.yml add the following code

main-menu: css: component: dist/css/main-menu.css: {}

This library has already been attached above inside menu--main.html.twig

By doing this any styles we wrote for the component will apply to the main navigation when it’s rendered in Drupal. Drupal libraries have no effect in Pattern Lab.

After completing the steps above, clear your Drupal’s cache and reload your Drupal site. You should see your Drupal menu being rendered with all the styles and markup we wrote throughout this post.

In closing

I’d like to admit that I went about the long way to get the main menu working on both, Pattern Lab and Drupal. There are other ways to accomplish this by using contrib modules such as Simplify Menu (full disclosure, I helped create the module), and perhaps Twig Tweak among several others, however, the approach I took here gives you the most control and that can make all the difference if you are dealing with a pretty advanced or complicated menu.

Categories: Drupal

Specbee: How Easy Is Drupal To Use? Leveraging Drupal CMS To Create Digital Experiences

3 June 2019 - 6:57am
The term Drupal invokes different feelings among different people, based on their professional background or on what they have heard or learned about the CMS . Over the years, Drupal CMS has evolved from a simple tool for hobbyists, to a powerful digital experience platform for Global enterprises. 
Categories: Drupal

Mediacurrent: The Drupal 7 Versus 8 Debate: An Insurer’s Guide to Upgrading

3 June 2019 - 5:56am

In the battle for insurance customer loyalty, the best customer experience wins. Equipped with a powerful content management system (CMS) like Drupal, insurance web teams are prepared for a competitive landscape crowded with fast-on-their-feet insurtech startups and looming giants of tech, Amazon and Google

The Drupal 7 Versus 8 Debate: A Team Approach 

Drupal 9 is coming. With the release just under a year away, the time is now for insurers’ teams to resolve their internal CMS debate — remain on Drupal 7 or upgrade to Drupal 8?

Bridging the customer experience gap is no small feat. However, insurance business leaders, marketers and developers are tackling the challenge head on. They comprise the team of experience builders with seats at the table for decisions like a CMS upgrade. To forward growth, their technology decisions are prioritized by data security and cost control. Also topping the list of evaluation criteria is a capacity for continuous improvement and swift speed to market of applications and functionality. Business leaders, marketers and developers bring unique approaches to achieve these common goals. In this article, we’ll evaluate Drupal 7 and Drupal 8 through the lens of these three stakeholders.

Current Drupal 7 sites have captured a glimpse of why Drupal is a fit for insurance, but the real power lies within Drupal 8. Of course, the decision to upgrade requires thoughtful consideration and planning. It’s a significant undertaking, particularly for large sites. However, factoring in the robust features of Drupal 8 with the appealing innovation forecast for Drupal 9—and the simple upgrade path connecting the two—insurers are likely to find that the advantages of upgrading far exceed the disadvantages. 

Drupal 7 Versus Drupal 8 for Business Leaders

Business leaders’ roles and responsibilities revolve around improving operating efficiency and cutting expenses. A flexible technology stack is crucial to stay competitive, perhaps even opening doors to collaborate with emerging insurtech startups. 

Focusing on the bottom line, insurance business leaders are understandably concerned with forecasting migration costs. 

Gaining a Competitive Edge 

With Drupal 8, insurers can gain a foothold to gain, and keep, a competitive edge in the market. 

  • Drupal 8 core offers many advantages, including improved performance and a better editorial and developer experience, to close the innovation loop.
  • To support the leap from Drupal 7, Drupal 8 now includes a built-in user interface to streamline migrations and offers more support for multilingual migrations.
  • More accessible web forms and other accessibility improvements in Drupal 8 serve to support legal compliance efforts and extend insurance offerings to the widest possible audience.
Benefits of Drupal 8 

Source: Mediacurrent

The many advancements in Drupal 8 core are reason enough to consider an upgrade, but contributed modules represent the best innovation in the Drupal ecosystem. The brilliant and globally spread Drupal community has shone a spotlight on Drupal 8. Drupal 7 simply hasn’t received the same level of enhancements and attention. Furthermore, passing on Drupal 8 now can also mean missing competitive advantages during the waiting time before Drupal 9. 

Looking ahead, moving to Drupal 8 now will make for an easier transition to Drupal 9. In the words of Frank Sinatra, “The best is yet to come...and won’t it be fine” (or should we say, nine?).   

Estimating Effort and Cost

Insurance business leaders are naturally concerned with total cost of ownership for their Drupal CMS. The migration roadmap is an important factor in that equation. 

Can you take your time to upgrade for Drupal 9? The answer is, technically, yes — but consider both migration and opportunity costs.  After clearing the jump from Drupal 7 to Drupal 8, expect future upgrades to Drupal 9 and onward will be significantly easier. 

Drupal 8 marked the beginning of a new continuous innovation model where advances in functionality are released rapidly on a six-month release cycle. Also, the Drupal 8 architecture is tuned so that a simplified upgrade path awaits to Drupal 9. This approach allows you to benefit from the innovation of Drupal 8 as Drupal 9 brews in the same codebase. 

Mediacurrent’s Drupal 9 Upgrade Guide can help prep your site for the move to Drupal 9. 

Drupal 7 Versus Drupal 8 for Marketers

Insurance marketers of all types, e.g., home, auto and life, view the customer experience as synonymous with digital experience. They have watched customer loyalty dwindle as the market has shifted online, where it’s never been easier to switch providers and shop online for quotes.

Earning Loyalty, Improving Customer Experience

Drupal 8’s appeal to marketers has grown significantly with major releases emphasizing ease of use and customer experience. Insurance organizations like MagMutual have embarked on the transition from Drupal 7 to Drupal 8 to better serve marketing teams:

Our Drupal platform allows our team to adapt to that very quickly to change marketing strategies as we continue to grow and evolve with our customer base.

Sallie Graves, CIO, MagMutual

Catch up on our CIO Interview with MagMutual to see how the organization is bringing new engagement strategies to life on an adaptable platform.

The key to forging deep customer loyalty lies in improving the customer experience from start to finish. In evaluating a CMS platform, marketers need a solution to tighten the reins on data so that it can be applied to the customer experience. 

For Guardian Insurance, Drupal 8 was a savvy place to land. Read Guardian’s Drupal 8 case study to see how they built a data-informed customer experience to win millennial insurance shoppers. 

Our Drupal 8 platform will serve as a foundation as we scale and enhance our web and mobile experiences for customers.

Peggy Maher, SVP, direct to consumer at Guardian Life Insurance 

Drupal 8 and Modern MarTech Stack 

Insurance marketers on Drupal 7 have most likely been with the same platform for a few years. If that rings true for you, consider the strategic doors that an upgrade can open. Think big about your website as a business tool. 

Consider questions like:

  • Does your conversion rate, bounce rate, site traffic and page load time indicate it’s time for a redesign?
  • Do you have a solution for customer journey mapping? Can you see what works, what doesn’t and, most importantly, why to engage prospective and current customers?
  • What usability improvements can help shape the customer experience?
  • Are there any areas of your digital presence lacking in personalization?

Drupal 8 is built for easy integration with your current and future marketing toolkit. Connect marketing automation, email service providers, CRM and more with Drupal 8 as the foundation for your digital experience ecosystem.

Drupal 7 Versus Drupal 8 for DevelopersSecurity 

Developers in the insurance space are tasked with managing the security implications for mountains of personal data and sensitive information. 

We mentioned previously that the developer community has been laser focused on innovation in Drupal 8 —this also applies to security. Major security flaws are first found—and first fixed—in Drupal 8. If that’s not reason enough to contemplate a move to Drupal 8, consider also the security implications of Drupal 7’s impending end of life where core maintainers check out of security duty.  Beware— your site’s data could become vulnerable to hacking and other exploits. 

A study from 2018 found 63% of hacked sites running Drupal had outdated versions when breached.  

Ahead of the Curve 

The Internet of Things (IoT), which includes smart home devices and new telematics solutions, gives insurers a new opportunity to learn from customers to serve them better. Beyond just a website, insurers need to meet customers on their screen of choice. Whether it’s mobile, wearables or smart home devices, screen time is all the time. Drupal 8 core is built with the elasticity to accommodate customers’ devices of today and tomorrow. 

For more considerations from a site builder’s perspective, read 10 Reasons Why You Should Start Your New Project in Drupal 8 on the Acquia Developers blog. 

Conclusion

For insurance providers, digital transformation is where customer experience meets Drupal 8 technology. With a highly proactive community behind the screens, the Drupal project is paving the runway for next-generation customer experiences. 

Drupal 7 to Drupal 8 converts like the State of Georgia and Pegasystems are but two examples of large, complex sites that saw significant gains from their migration. Acquia and Mediacurrent have proudly supported these organizations on their Drupal journey. Watch their migration stories here

Master Your Drupal 8 Upgrade With a Trusted Partner

The final crucial consideration on the road to adopting Drupal 8 is choosing a migration partner. As a leader in Drupal development, strategy and design, Mediacurrent has partnered with high-profile clients ranging from large enterprise businesses to education. Together with Acquia, our talent, tools and processes ensure a smooth and successful migration. Partnering with us will help you establish the personalized digital experiences that capture customer loyalty — leveraging flexible open source technology and with the lock-tight security the industry requires.

Categories: Drupal

Lullabot: Behind the Screens: Behind the Screens with Karl Kedrovsky

3 June 2019 - 12:00am

Fresh off the inaugural Flyover Camp, co-organizer Karl Kedrovsky talks organizing local user groups, what it means to give back to the community, and why some furniture is timeless.

Categories: Drupal

Promet Source: The Buyer’s Journey as a Leadership Model

2 June 2019 - 6:44pm
Astute marketers have stepped up to the concept of the Buyer’s Journey.  Taking the time to understand the full range of client personas and to gain empathy for the distinct phases that clients progress through as they explore and compare solutions, is now a key component of the marketing mix. Let’s look at the potential for applying the concept of the Buyer’s Journey to a new leadership model that can serve as an essential resource for setting employees up for success. First: a review of how understanding the Buyer's Journey is at the core of marketing effectiveness.
Categories: Drupal

DrupalEasy: DrupalEasy Podcast 219 - AmyJune Hineline - Contribution Tour 2019

1 June 2019 - 3:52am

Direct .mp3 file download.

AmyJune Hineline, Open Source Community Ambassador at Kanopi Studios joins Mike Anello to talk about her upcoming Contribution Tour 2019, as she visits numerous Drupal and WordPress events to help train new contributors.

Discussion DrupalEasy News Upcoming Events Sponsors
  • Drupal Aid - Drupal support and maintenance services. Get unlimited support, monthly maintenance, and unlimited small jobs starting at $99/mo.
  • WebEnabled.com - devPanel.
Follow us on Twitter Subscribe

Subscribe to our podcast on iTunes, Google Play or Miro. Listen to our podcast on Stitcher.

If you'd like to leave us a voicemail, call 321-396-2340. Please keep in mind that we might play your voicemail during one of our future podcasts. Feel free to call in with suggestions, rants, questions, or corrections. If you'd rather just send us an email, please use our contact page.

Categories: Drupal

Mediacurrent: Improve Your Remote Work Productivity With the ‘Shutdown Ritual’

31 May 2019 - 12:58pm

For all its benefits, working remote— as most of our Mediacurrent team does— still has its challenges. 

The one that people ask me about the most is, "how do you keep any kind of work / life balance when your work and home are inseparable?" For me, the answer to this has been what I call my "shutdown ritual." It's basically just how I try to end my workday every day, but I've found putting some thought into a routine has helped a lot to make my evenings more relaxing and my mornings more productive.

In this post, I'm going to cover:

  • what a shutdown ritual is
  • the benefits  of having a shutdown ritual
  • my specific shutdown ritual
What is a shutdown ritual?

So first, what is a shutdown ritual?

A shutdown ritual is a set routine of actions that you perform at the end of each work day to finalize your day and signify that your work day is done.

I got this concept from an excellent book called Deep Work: Rules for Focused Success in a Distracted World, by Cal Newport. 

His core argument in the book is that the most valuable skill in our economy is deep focused work and that is becoming increasingly rare. If you want to set yourself apart, cultivating a deep work ethic is the way to go. He outlines several rules and guidelines you can follow to start cultivating this habit.

One of the tools he recommends is the shutdown ritual.

The bare outline of the shutdown routine that he outlines in Deep Work is:

  1. update all todo lists
  2. read over the todo lists in their entirety (reprioritizing items as necessary)
  3. review the calendar for the next two weeks, make sure any todos required for events are on the todo list
  4. write down a plan for the next day
  5. close everything on your computer
  6. say a magic phrase, like "Shutdown complete" or "I'm outta here"

Newport also discusses the shutdown ritual briefly on his blog: Drastically Reduce Stress with a Work Shutdown Ritual.

Why do a shutdown ritual?

One of Newport's biggest criticisms of modern workers is that we're always on, and because of this, our attention and energy is too dispersed. We can get notifications or just compulsively check Slack or email, even outside of work hours. But deep work requires disciplined attention and energy. If you want to do deep work during the day, you need to make sure you are not constantly doing shallow work (even off the clock). 

Benefit 1: A defined ending

One of the main benefits of the shutdown ritual is having a well-defined end of the workday. Once the shutdown ritual is done, work is done. Don't think about it. Don't worry about it. Don't check email. Don't look at Slack. If you want to be your most productive self, you need to take a complete break until the next work day.

Now it's time to do all the relaxing evening things like feeding your kids and washing the dishes.

When I tell people I work from home, a majority of them say something like, "You must feel like you're working all the time" or "How do you separate your work life from home life?" and I have certainly found it to be a bigger challenge to turn off at the end of the day since I don't really leave "the office." The shutdown ritual helps define the end of the workday and the beginning of being fully present at home.

It has helped me be more productive during the day and helped me have more focused attention with the family after work.

Benefit 2: Confidence in the ending

The important part about the steps in the shutdown routine is giving you confidence that everything you needed to do is done. 

If you're like me, you might be washing the dishes and still be debugging code in your head. Or you might suddenly remember an important email you were supposed to respond to and didn't. Or you might start thinking about a meeting on your schedule tomorrow that you're anxious about.

But the steps of your shutdown ritual should help you capture all these thoughts before you end your workday. You want to capture them and write them down somewhere, so they aren't floating around in your brain all night. 

Sometimes, you might be in the middle of your shutdown ritual and remember something that can't wait until tomorrow. That's fine, go ahead and do it and then start your shutdown ritual over.

Because once your shutdown ritual is over, and a work worry comes into your head, you want to be confident to say to yourself: 

I went through the shutdown ritual. I know that everything important has already been accounted for. Therefore, there is no need to worry.

And move on with your night.

Benefit 3: Having an anchor for other habits

The last benefit I'll mention is that having a shutdown ritual at the end of the day can be a helpful anchor for other habits.

If you have a well-established habit like a shutdown routine, you can leverage it to help establish other habits. James Clear calls this Habit stacking. The idea is that by pairing a new habit with one that already exists, you make it more likely to stick to a new habit.

Some examples of habit stacking with the shutdown ritual:

  • after my shutdown ritual, I will take 5 deep breaths and smile
  • after my shutdown ritual, I will put on my workout clothes and go to the gym
  • after my shutdown ritual, I will call a friend
     

A shutdown ritual can help you end your workday productively and launch a new habit or hobby to make the rest of your life even better as well!

My Shutdown Ritual

Here's what my shutdown ritual looks like. At 5:15pm everyday, I get a friendly message from slackbot to start my shutdown ritual. 

You can set a reminder in Slack like this:

/remind me to 

Time to start your shutdown ritual!

- reconcile timesheet
- check email for anything requiring urgent response
- add new / outstanding tasks to todo list
- check JIRA
- skim task lists
- check calendar for tomorrow
- make a rough plan for the next day

Shut down complete

every weekday at 5:15pm

For me, this is actually about 45 minutes before the end of my workday. I used to have the reminder for 15 minutes before I signed off, but I could never get to a stopping point and do the shutdown in 15 minutes. 45 minutes gives me enough time to start looking for an exit in my current work and to go through the routine.

Here is what is on my shutdown ritual list:

  • reconcile timesheet
  • check email for anything requiring urgent response
  • check JIRA
  • add new / outstanding tasks to todo list
  • skim task lists
  • check calendar for tomorrow
  • make a rough plan for the next day
     

Reconcile Timesheets

I take a look at my time tracking software and make sure all my time is accounted for.

Check Email

I go through my email inbox, responding to anything that is really urgent, and adding tasks to Todoist for anything that is not. My goal is to delete as many as possible.

Check JIRA

I open up JIRA to see what tasks are assigned to me, and add them to Todoist, if they aren't already there. I sometimes remember things I said I was going to do but didn't (like update a ticket or assign to someone else) so if I can quickly do that I will.

Skim Todo lists

This gives me a broad view of what's going on. Sometimes I notice a glaring error or remember something that completely slipped my mind, so I add that here. I also sometimes reorder things based on how priorities changed throughout the day.

Check Calendar

Next, I check my calendar for tomorrow. Do I have any meetings tomorrow that I have a deliverable for? Did I complete the deliverable? Any conflicts?

Make a rough plan for the next day

The last item on my list is making a rough plan for the next day. This really sets me up for success in the morning, and helps prevent a slow, groggy start to the work day. Sometimes I make my plan in Todoist just by setting due dates for todos for tomorrow and putting them in the order I want. Other times I have a simple text file where I make a list. It kind of depends on what projects I'm on and the kind of work I'm doing from week to week.

Shut down

I close all applications on my computer. I put the computer to sleep or shut it down. Sometimes I say "shutdown complete"

Sometimes here I tidy up my desk.

I start singing "It's a wonderful day in the neighborhood" and change into my house sweater and house shoes.

The work day is done. I'll be back tomorrow. 

And that's how I end my days productively with the shutdown ritual.

Categories: Drupal

Drupal Association blog: Once again, we are adding a little color for Pride Month

31 May 2019 - 10:11am

In June last year, we changed our Drupal Association logo on social media platforms to add a little color for Pride Month and I am really happy to say we will be doing the same again this year.

Since last year, we have introduced better tools for understanding the demographic groups in Drupal and I asked for a report on that. Quite rightly, I don’t have access myself - it is very much locked down. I was interested to see that, of those confirmed users who have filled something into the field (including “none” or “prefer not to answer”), 15.8% have indicated they identify as LGBTQIA. That’s far more than I expected!

We would love to continue to improve our statistics; we're asking everyone to complete the data in the demographics field, even if that is to click “none” - it’s a totally valid and useful response. Go to your user profile, click edit, and find it in the “Personal information” tab.

Finally, whilst the Drupal Association is an educational non-profit and does not advocate policy, I have been personally reminded this week of the extraordinary bravery, friendship, and sheer commitment to overcome challenges by people in the LGBTQIA community and I wanted to help celebrate that in any way we can.

You are strong and you are beautiful. Thank you for being you.

Categories: Drupal

Hook 42: Search and Facets and Queries, Oh My!

31 May 2019 - 8:24am
Search and Facets and Queries, Oh My! Lindsey Gemmill Fri, 05/31/2019 - 15:24
Categories: Drupal

Drudesk: Interesting option for news websites on Drupal — featured news collections

31 May 2019 - 7:46am

Drupal is a great choice for media websites. This is due to easy content editing, flexible moderation workflows, advanced media handling, and much more.

And, of course, media and news websites on Drupal can enjoy unlimited content display options for. Today, we would like to show you one of them that we implemented for our customer’s Drupal website — so-called featured news collections, aka grouped news.

Categories: Drupal

Mediacurrent: What’s New in Rain 3.0

31 May 2019 - 6:06am

Mediacurrent created the Rain Install Profile to build fast, consistent Drupal websites and improve the editorial experience. Rain expedites website creation, configuration, and deployment.

The Mediacurrent development team is pleased to announce some new updates to the Rain distribution in version 3.0. We have now made Drupal project template easier to use and maintain by splitting Rain content features (all of which are optional) from the main “base” package. This allows developers flexibility in which features they use while still pre-configuring modules that jump-start development.

There are some key changes that we will highlight here:

  1. The Rain package has now been split and renamed to mediacurrent/rain and mediacurrent/rain_features respectively. The latter repository now contains all the optional content features and their dependencies while the base package pre-configures the base installation.
  2. An UPDATE doc has been added to the Rain repository which explains in detail how to update from the 2x branch to 3x. This document will be kept up to date with any future changes that require manual changes or explanation.
  3. A few new dependencies have been added while several less frequently used dependencies have been removed. The UPDATE doc gives further details on what was added or removed and how to upgrade.

Note that the Drupal-project template is only used for provisioning new projects. Any project that currently uses the 2x version of the Rain distribution will not break or be forced to update. Updates to 2x will continue through to Drupal core 8.8 but then be sunset in favor of the 3x branch. Overall the process of updating from 2x to 3x should be relatively painless. 

If you experience any problems updating please file an issue in the official Rain project queue on Drupal.org: https://www.drupal.org/project/rain.

Installing Rain 3.0

To install the Rain distribution, we recommend you leverage our Drupal project template which includes a VM and Guardr security along with the Rain install profile and other tools.

Our recent article entitled “Drupal 8 Rain & GatsbyJS Integration” covered how to install Rain using the project template so we will recap the first step here which remains the same in version 3.0.

First you will want to create a repository wherever you typically host your Git projects (i.e. Github, Bitbucket or Gitlab). Once you have that setup you can clone Mediacurrent’s repo and point the origin back to your Git repo.

Example:

git remote set-url origin git@bitbucket.org:mediacurrent/shortcode_project.git

Next, you will want to initialize the project. You can do that by running the following commands with your local host name and IP.

Example:

composer install

composer drupal-scaffold

./scripts/hobson project:init example.mcdev 192.168.50.4

Finally, to build the project and run the install you can simply run “./scripts/build.sh” which runs composer install as well as the Drupal install. Note that the project README has more detailed instructions but this will give you an idea how to get up and running quickly.

Video Tutorial for Installing Rain

Categories: Drupal

OpenSense Labs: Open Source : A community and culture

31 May 2019 - 5:28am
Open Source : A community and culture Harshit Fri, 05/31/2019 - 17:58

Open source communities are more about sharing ultimate value rather than just building something. They love to contribute and impact people all across the globe. Open source culture is more than just reusing free code on GitHub to get products to market faster.

The open source culture embraces an approach to software development which totally lays emphasis on all round collaboration and helpful nature, the teams tend to focus more on increased competencies instead of core infrastructure and cross channel implementation.  The culture embraces an approach to software development that emphasizes internal and external collaboration, an increasing focus on core competencies instead of core infrastructure, and implementation of DevOps processes commonly associated with microservices and cloud native technologies. 

What are the key traits of an open source community and culture? A responsibility to contribute 

Open source involves a broad range of technologies and a diverse set of people who bring some or the other expertise to the table. Often people are more inclined towards contributing the best of their individual abilities. They feel the responsibility to contribute and make sure they are often involved in the betterment of multiple projects and are they are often people are members of multiple projects, involving a broad range of technologies. Frequently, member recognition isn’t set by how much they’re paid or what titles they’re called. It’s how much of a headache is solved or endured for others. 

 All round responsibility and accountability

Accountability between members begins when they know each other as people and professionals. It’s especially important to have consistent written contact, ad hoc and scheduled video conferencing, and meeting in person at least once a year to build personal bonds.

Seamless and undeterred Collaboration

Collaboration for an open source organization culture stretches across multiple areas. Well into domains like organization goals, cultural fit, and more.

Team members who define together what a cultural fit is demonstrates what's important to the organization. Just as, a united group of passionate hackers and designers who take part in the joys of community sharing, they want to hire those having like interests and similar ideals.

More inclination towards automation

Automating tasks within an organizational culture is about respecting people’s effort while not wanting them to be distracted from getting the right thing done when needed. 

Organizational members focus ultimately should be on what’s important to them and, in turn, the organization.

Consistency in everything 

The consistency of people, processes, and management thereof is the glue of an open source organization culture. Without consistency of action, principles and guidelines flounder despite the best of intentions.

Streamlined Processes

It's extremely hard work to develop fundamentals when shortcuts and hacks so often seem to provide great short-term benefits. However, consistency is the key to positive long-term results.  

For example; there needs to be a detailed and consistent process in hiring for fit, not skills, and for the long-term. Beyond these two key criteria, the candidates should also be demonstrably capable, driven, and passionate for the role to be filled.  

An underlying passion 

The underlying spirit to do good work is hard to find, it comes to you upon due search. And it is more powerful than any other driving force in the professional landscape. You will strive harder and harder for the things which mean something to you and the Drupal community makes you feel connected to their growth, you grow as they grow, which ultimately helps you feel the need to deliver sheer excellence. 

Shared Responsibility

At an organization, culture becomes the way you work. Through culture, there’s a shared responsibility for good communication and positive results. In communicating with clients and one another, it needs to be timely, considerate, and accurate. 

Drupal: For great community and culture Drupal has a predefined set of values and principles

Drupal, since its inception was built around a foundational set of values and principles. The agenda was to gather a community of like minded individuals and bring them on the same page about the vision and mission of the product and its roadmap.

Source: Dries Buytaert’s Blog Drupal’s code of conduct and CWG 

Drupal community's Community Working Group comprises of independent volunteers who strive hard to protect and promote the health of the entire Drupal community, they also help and maintain and keep on track the Drupal Code of Conduct and also act as the escalation body to help mediate conflict between community members. 

What should make you want to contribute to Drupal?

Can you imagine hundreds of thousands of people relying on your code or waiting to get some feedback from you? Their business’s growth is dependent on the advancements you make in your contribution. The more you contribute the better your worth and stance in the community, what is better than people believing, listening and relying on you for some advancements in the community? 

Final word 

Open Source is here to stay and develop software that has a huge impact upon individuals and businesses. People continue to make efforts because of their underlying passion for building great things and open source communities are an example of that. 

blog banner blog image Open Source work culture Blog Type Articles Is it a good read ? Off
Categories: Drupal

OpenSense Labs: Myths about OpenSource Technology

31 May 2019 - 5:02am
Myths about OpenSource Technology Harshit Fri, 05/31/2019 - 17:32

Open source software has been receiving some serious criticism and some serious applauds from the tech community all across the world. People beg to differ on a lot of ideas about it, it has led to some serious publicity over these years. But hold on a second, with publicity comes myth and with myth comes some serious thoughts and people get mislead. Which at the end of the day hampers people’s thought process. Some think source software is totally free to use and some question its security quotient.

Open source technology has made it nearly possible to do so much in literally no time.

Let’s get into some myths about open source technology about back them with actual facts.

Myth #1: Open Source is free

Many people get more inclined towards open source software because they are misled into thinking that open source software is free to use and there will be hardly any software run costs in the future. On the correct note, this is not true, open source means open source code and that you can easily  access the source code of any system if you are enrolled in any given community.

To break it into a more understandable concept:

An Open Source Content Management System vendor can charge you for the services being provided around the open source software, And by far there is no link between the software license and the what you have to pay to get out of it.

Take Drupal for example, it's free to download and use for personal purposes but the advancements have gone so far that you will need to seek expert services for utilising the software to it's very best potential.

What's the free part?

You are free to access the source code behind the functionality and alter it for your own use case but provided that you abide by the terms and conditions in the license agreement.

Myth #2 - All open source software is Linux based

This myth is one of the most common and it’s fair enough for people to believe, especially when they are new to the open source landscape or just starting off their careers. When OSS came into the picture, this was the most commonly When people mentioned OSS, the quick and common assumption about it is that OSS only runs on the Linux operating system. It is a quick and easy assumption to make as many open source programs are made with Linux availability as a prime motivator.

MYTH #3: Contribution to OpenSource is only for startups

In the government sector, open source contribution is strong and they have the deploy teams to be able to handle and make the best use out of the open source software. Hence they end up making more and more contributions in the process.

On the other hand, the developers in the public sector do contribute to the code base but they have to expect some benefit out of it, either in the financial aspects or on the career trajectory aspect.  Some state and federal agencies like code.ca.gov and code.gov are using code sharing and collaboration to help the government in cutting down the duplicacy costs.

Drupal as an open source software is great for giving startups a heads up for showcasing their expertise and content. On the other hand, it is also one of the best solutions when it comes to enterprise requirements. You can custom build your content management systems which serve for a large scale content repository.

Myth 4 : OSS is less secure than proprietary software

So, is open source software inherently more secure? Of course not. Before going for any open source solution, you should look into its security thoroughly.

You can always review its version history and the frequency of security updates provided by the supporting community, you should also look for the amount of work being poured into its security segment and what is the word of mouth like?

Maybe you’ll even find an independent agency vouching for a product’s security, or certificates proving its reliability, or a respected colleague who can assure you that it's the best option on the market.

Additionally, you can see what tools your competitors, partners, and established companies in the industry are using. For instance, Ruby on Rails is used by 500px and Airbnb, and that alone is a great indicator that this framework is reliable enough for startups.

Drupal is considered one of the most secure content management systems across the world. Why? Because of its dedicated security team and the frequent security releases which make the system more and more robust over time.

Myth 5 - OSS is not scalable

Open source software is never designed to fit in everyone's shoe, the entire agenda of open source software is to make sure people can make it fit in their shoes with the help of respective expertise and their organisational requirements.

Take Drupal for example, It is designed to be scalable and adaptable in comparison to its commercial competitors. It is supposed to be evolved by the community and hence meet enterprise expectations. Developers have been able to adapt projects to small  and enterprise size requirements.

Myth 6 - Open Source is not maintainable

It is a strong assumption that open source software is harder to maintain and it can lead to possible confusion among the user crowd. There is always a sense of responsibility and motivation to improve the code and better the software overall, not for monetary gain, not for any gain other than a feeling of social responsibility.

Open Source softwares generally track all the upgrades, improvements and maintenance measures using paid tools to help maintain a record of the versioning and who was the code contributed by. See? The community has already got the maintenance concern or issue covered before it even gets started.

One more strong foothold about open source is that it can be managed and the work can be overtaken by other technology service providers, in case your technical team decides to move on. So, you should now be sold on the idea that open source is maintained like a premier software.

Myth 7 - OSS doesn’t have a support system in place

Since there is no one to hold accountable openly, people think open source software is less cared about or not supported so well in the industry.

But things are the absolute opposite, the amount of care and support put in by the community support teams is enthralling and it can completely change your mindset about it. Companies which run on the software bring in their brightest minds to help provide support for their software so that they don't get shut down at the end of the day due to lack of sincerity in support and care.

Final word

There might be a ton of myths and rumors circulating within and outside the communities but one should always think and work this out before making any harsh assumptions. Myths often keep us from adopting or trying out a technology and this has to come to an end sooner or later because the technology and the community speak for themselves.

blog banner blog image Open Source Blog Type Articles Is it a good read ? Off
Categories: Drupal

OpenSense Labs: Brace yourself, Drupal 9 is Coming!

31 May 2019 - 4:45am
Brace yourself, Drupal 9 is Coming! Jayati Fri, 05/31/2019 - 17:15

With Drupal 9 on the verge of release in June 2020, the Drupal community has about 18 months to map out a transition plan. The latest versions of Drupal in recent times saw a major breakthrough from the past versions. As the philosophy of development has changed, Drupal 9 is said to be built in Drupal 8 and the migration will be super easy this time.

Released in 2011, Dries announced the end-of-life (EOL) for Drupal 7 to be due in November 2021 after serving for more than 8 years. However, many people are still on Drupal 7 given the compatibility issues in the two versions which caused major disruption and migration became a task for developers. However, the new philosophy makes it easier to plan and anticipate any unforeseen obstacles that you may encounter. Are you prepared for it?

Planning for Drupal 9?

Launching with the objective to modernise the dependencies such as Twigs and Symfony and to remove support of deprecated APIs, Drupal 9 is making its way into the Drupal community soon.

Every new information being released about the update and new features is gearing us up for the big leap. The first and foremost action to be taken in consideration is to plan and upgrade no later than the summer of 2019. Experts believe, as long as your modules are updated with minor releases like Drupal 8.7 and the upcoming Drupal 8.9 in December 2019, there won’t be much to worry during the main release of Drupal 9. Being upto date with Drupal 8 is a crucial step for adaptability and easier usability in the future.  

Dries Buytaert wrote recently in a blog:

‘’Instead of working on Drupal 9 in a separate codebase, we are building Drupal 9 in Drupal 8. This means that we are adding new functionality as backwards-compatible code and experimental features. Once the code becomes stable, we deprecate any old functionality.’’ What’s New in Drupal 9?

With a lot of buzz around the new features to be delivered, let’s understand few important reasons for the strategic release of Drupal 9:

  • The innovative model of Drupal 8 had new releases every six months which led to adding of new features and enabling improved ways of problem solving. However, Drupal 9 will deprecate the codes which are needed for backward compatibility. In the process, it will provide an opportunity to remove the codes and anything else that is no longer needed.
  • As of now, Drupal needs to adhere to the vendor support life cycles and integrates with common PHP projects like Twig and Symfony. But the third-party dependencies will reduce with Drupal 9 and we’ll have supported versions of software for a long time such as Twig 2 and Symfony 4/5.
Why upgrade Drupal 8 when Drupal 9 is coming?

Drupal 9 is not being built on a new core and its functionalities will not look alien to Drupal 8 users. Instead, they will be added to D8 as backward-compatible code. Only with time and familiarity, as the new features will hold a stable position and mark their success, the older counterparts will be deprecated. As a result, D9 will be stripped of all deprecated code and only the complete collection of stable features will be termed as Drupal 9.

For example, in Drupal 8.0.0, the Drupal::l($text, $url) was deprecated. Instead of using \Drupal::l(), you can use Link::fromTextAndUrl($text, $url). The \Drupal::l() function was marked for removal as part of some clean-up work.

What does it Mean…

With no new paradigms of development and yet being a big leap, how will Drupal 9 change the workings?

For Core Contributors:

Your tasks will get limited in Drupal 9 even before the release. Making the quality robust and release more predictable, new features will remove deprecated functionality and lead to Drupal's dependencies to a minimum.    

For contributed module authors

Similarly, authors can also start working on the compatibility issues before the release as their Drupal 8 know-how will still remains relevant in Drupal 9 with no dramatic changes in the core.

For Drupal site owners

The release of Drupal 9 will make the upgradation much easier for site owners. It will be the same as Drupal 8, only with its deprecated codes removed. According to the experts, keeping your modules and themes stay up-to-date with the latest Drupal 8 APIs will do and a 12- to 18-month upgrade period will be sufficient.

What happens to module, profile and theme maintainers?

Though existing Drupal 8 sites have a year and a half to upgrade to Drupal 9, the technology in Drupal 9 would be already battle-tested in Drupal 8. The set of tasks for module and theme maintainers involve getting updated with the new and better APIs. It would be a mandate to check if your code is compatible with Drupal 9 as it may hold invalid when sites migrate. However, do not wait till the release of Drupal 8.8 which is expected at the end of 2019. As six months will be a limited time to upgrade to Drupal 9 for complex codes, it’s advisable to start assessing now.

How to Prepare for Drupal 9

The big catch in this whole drill of migration is to make sure that you no longer use the deprecated codes. Following are few ways suggested by Acquia:

  • Be updated with Drupal 8 features and modules
  • Create a report for deprecation using Drupal Check.
  • Check for your active modules which might be deprecated at api.drupal.org
  • Address a consolidated list of errors that can occur and need upgradation to Drupal 9 by generating a ‘’readiness assessment’’.
  • Use the latest versions of dependencies in line with Drupal 9.
Wrapping it up

As Drupal 9 will emerge as a phoenix from the ashes of Drupal 8, Buytaert sums it up best, “The big deal about Drupal 9 is that…it should not be a big deal.”

Excited? Have questions about how Drupal 9 will impact your site? Want to chalk out a plan for upgradation? We are here to help. Drop a line to our experts at hello@opensenselabs.com.

blog banner blog image Drupal 9 Drupal 8 Drupal Modules Blog Type Tech Is it a good read ? On
Categories: Drupal

OpenSense Labs: Run to Glory: The Drupal Effect on High Performance Websites

31 May 2019 - 4:06am
Run to Glory: The Drupal Effect on High Performance Websites Shankar Fri, 05/31/2019 - 16:36

Usain Bolt, in his last appearance at the World Track and Field Championships in 2017, stood third by a narrow defeat in the 100m race leaving behind a yawning gulf. Bolt finished the race just a hundredth of a second later than his fellow competitors.

Every (nano)second counts!


Such is the importance of speed that even a three-time Olympic gold medallist, Usain Bolt, had to bear the brunt of those nanoseconds. Someone might ask “How do I get started learning about web performance?

Visualise that it is the Mega Book Sale Day and the bookworms are thronging the best performing online stores that are selling the books of renowned authors. Coping with such a colossal turn-up, a site with much faster page load speed would be preferred over the ones that are a bit sluggish. Drupal offers a superb platform for an effective website performance optimisation thereby making it faster and user-friendly.

The Significance of Website Performance Optimisation

Web performance optimisation involves monitoring the performance of web application analysing and assessing it, and identifying the best practices to improve it.

Web applications are a combination of server-side and client-side code. To improve the web performance, both the sides need to be optimised.

The client-side optimisation relates to the initial page load time, JavaScript that runs in the browser, downloading all of the resources etc. that are seen in the web browser.

The server-side optimisation relates to database queries and other application dependencies to check how long it takes to run on the server for executing requests.

Performance optimisation is significant because of the following factors:

User retention

BBC found that they are losing out of 10% of users for every extra second their website took to load. Also, DoubleClick by Google found that if the web page took more than 3 seconds to load, 53% of mobile site visitors tend to abandon the page.

 

We all strive to make our users engage in a meaningful interaction with what we have built for the web.

So, if it is an online store, you would like to see a prospective audience turning into buyers. Or if it is a social networking web application, you would want your online visitors to get ensconced in an arresting interaction with one another. High performing sites play a vital role in engaging and retaining users.

An increase in user retention by 5% can result in increased profits by up to 95%.

It costs 5 to 25 times more to attract new customers. So, even a 5% enhancement in customer retention can lead to increased profits of 25%-95%.

By redesigning their web pages, Pinterest combated a 40% reduction in perceived wait times and witnessed a 15% increase in their search engine traffic and sign-ups.

COOK, a provider of high-quality frozen meals, was able to address the average page load time and cut it down by 850 milliseconds which resulted in 7% in conversions, 10% increase in pages per session and 7% decrease in bounce rate.

Improved Conversions

User retention ultimately leads to better conversion rates. Slow sites can have huge repercussions on the business revenues. Better performance of sites can be highly profitable to shore up revenues.

Source: Hubspot

According to 2016 Q2 Mobile Insights Report by Mobify, 1.11% increase in session-based conversion was seen for every 100ms decrease in homepage load speed. Moreover, a 1.55% increase in session-based conversion was noticed for every 100ms decrease in checkout page load time. The outcome was an increase in the average annual revenue by approximately $530,000.

Also, AutoAnything revved up their sales by 12-13% after decreasing their page load time by half.

User experience

When sites ship tons of code, underwhelming performance persists as the browsers chew through megabytes of it on snail-paced networks. 

Source: Impactbnd

Even the devices with limited processing power and memory can find it hard to cope up with the modest amount of unoptimised code. With poor performance taking centre stage, application responsiveness and availability diminishes.

Better optimised code lead to high functioning and better-performing sites which in return alleviate the digital user experience.

Strategising the web performance

Formulation of strategies to improve web performance can be done in two ways:

Bottom-up strategy

Also known as performance-by-design, the bottom-up strategy is the preferred approach to integrate performance as a core development principle. In this strategy, the performance optimisation principles are framed, applied and maintained. This is done right from the application design phase. 

The key stages that are involved in this approach are stated below:

  • Performance principles are laid out.
  • The key pages/transactions are identified, optimised accordingly, and then performance principles are executed.
  • Performance SLAs (Service Level Agreement) are monitored and maintained.

Here's a chart by Infosys which explains it best: 

Key stages involved in bottom-up strategyTop-down strategy

If an existing application needs to be optimised for performance, top-down strategy comes into play. This is a preferred option only when the legacy applications are being optimised for high performance. Also, this is not cost effective and the optimisation options are limited.

Steps involved in this strategy are as follows:

  1. Factors that are contributing to the page performance are assessed using tools like PageSpeed Insights, WebPageTest etc.
  2. Activities that would lead to maximum performance improvements are optimised.
  3. Other optimisations with subsequent releases are iteratively implemented.

In addition to these strategies, one must consider an important methodology called ‘Performance Budgeting’. It means setting a performance threshold that you aim to stay within. You can safeguard your site speed and detect any regression in the performance by setting up a performance budget to ensure continual eye on performance.

This is how we do it!

Expected load time and Google page speed score, as shown below, is the core of our perpetual and iterative development process.

The above chart shows that, while applying performance budgeting methodology, we take note of:

  1. Average load time of 2 seconds or less
  2. Defined maximum limit on page size and number of HTTP requests
  3. Verification of all server site tuning for an efficient and responsive site
  4. Google page speed performance grade of above 90
  5. Implementing performance optimisation
Implementing Performance Optimisation

How to speed up my Drupal website performance? Drupal is loaded with an enormous amount of features which, when implemented smartly, can lead to superfast page loads. There are several techniques to make your website faster by leveraging the amazing features of Drupal.

Keeping your site and modules updated

Outmoded modules can deter your efforts in speeding up your website. Thus, it is important to update every module enabled on your Drupal site.

Uninstalling unused modules

Like those outdated modules, it is significant to keep a tab on least used or no longer used modules. The number of Drupal modules installed on the site is directly proportional to the time taken for code execution which affects page load time. Uninstalling unwanted modules can alleviate execution time.

Moreover disabling the modules also adds to the execution time of the code. So, a complete removal by uninstalling the unused modules can speed up the Drupal site.

Optimising Cache

Optimisation of native cache system ensures that all the web page components are stored in an easily accessible location after a user visits your site for the very time. So, whenever the user visits your site again, the page elements are loaded from the cache which leads to increased page load speed.

Drupal has the provision of advanced caching with a great set of modules:

  • Internal Page Cache module helps in caching the web pages for anonymous users to increase the speed for subsequent users.
     
  • Dynamic Page Cache module caches web pages for the anonymous and authenticated users and is recommended for the websites of all screen sizes.
     
  • BigPipe module allows your users to quickly see the unchanged, cacheable page elements while the personalised content is exhibited next. This technology was inspired by Facebook. Drupal 8’s much improved render pipeline and render API is of huge help.
     
  • Redis module helps in integrating Drupal with Redis key-value store thereby providing a robust cache system for static pages.
     
  • Varnish module lets you integrate Drupal sites with an advanced and fast reverse-proxy system - Varnish cache -  to serve static files and unknown page-views quicker and at high volumes.
Optimising database

Website coding is not the sole thing that can be optimised. Optimising database by regularly cleaning up the data and removing the unwanted piece of information.

Memcache API and Integration module, help in the integration of Drupal and Memcached. It stores your data in active memory for a limited period of time thereby making it faster to access. 

So, instead of making queries to the database constantly, the information is readily available. Such a system also works on the shared web hosting plans.

Incorporating a Content Delivery Network (CDN)

Components like CSS, JavaScript and media are hosted by CDN and served to the online visitors from the nearest location. This can help in mitigating the page load time by rapidly delivering web page components.

Drupal module, CDN, helps in the integration of Content Delivery Network for Drupal websites. It changes the file URLs so that files like CSS, JavaScripts, images, videos, and fonts are downloaded from the CDN instead of your web server.

Optimising bandwidth

Aggregating all CSS and JavaScript files to make them load together is what bandwidth optimisation refers to. Such a parallel processing ensures that all the page elements can be seen by the users almost immediately.

Optimising images

Drupal 8 core is loaded with image optimisation feature to set the compression ratio of the images and fine-tune the page performance.

Moreover, the size of the images for screen sizes of different devices can be optimised in Drupal 8 to enhance the page load speed.

Handling 404 errors

Whenever something on the website breaks to cause a 404 error, it can lead to sluggishness. For instance, a failed image can damage the performance of the site. Drupal 8 provides a module called Fast 404 which utilises the resources better and whitelists files and verifies pathways of problem.

Managing the use of CSS and JavaScript

CSS and JavaScript provide wonderful methods for customisation and flexibility. But, too much of good things can be troublesome for your websites. Avoiding excessive use of CSS files and JavaScript use and keeping the code to a minimum can improve performance.

Advanced CSS/JS Aggregation, Drupal module, can help in keeping a tab of your front-end performance by aggregating CSS and JavaScript files to improve speed.

Using lazy loading

Lazy or on-demand loading is a perfect way to optimise your site’s performance. In this method, you split your code at logical breakpoints and then load it once the user has done something that requires a new block of code.

Basically, in traditional websites, all the images and content are preloaded into the web browser when someone accesses the site. Lazy loading loads these elements as soon as a user scrolls to view a content.

Blazy, Drupal module, provides the functionalities of lazy loading and multi-serving the images to save bandwidth and server requests.

Better web hosting

It is of consummate importance that, while implementing every possible tips and trick and utilising the Drupal’s amazing features, you chose the best web hosting provider that will decide your site’s ultimate speed, stability and security.

Upgrading the server hardware

Server scaling is of paramount importance in order to optimise the website. And to do so, you can either upgrade the server hardware by scaling vertically or by scaling horizontally. When you scale vertically, more resources are thrown at the same server and is considered the simplest approach of scaling the hardware. And when you scale horizontally, more servers are added to separate the load. This approach, when executed well, can minimise the load that any single server receives. In case, you have multiple app servers for Drupal, you will need a method of deploying code to each server concurrently. For example, plartform.sh and pantheon.io can manage the entire hosting setup for you but if you are handling it by yourself, you would require rsync setup or git push to each of your servers etc.

Case Study

The Drupal website of the Farm Journal’s MILK was optimised for high performance and better search engine rankings with a help of carefully drafted audit report by Opensense Labs.

In this section, we will focus on how we used our Drupal expertise to resolve the performance issues.

Project highlights

Previously segregated CSS and JS files cached separately which escalated the page load time. We aggregated all these files and put them in one place which assuaged the page load time.

Moreover, we used Advanced CSS/JS Aggregation Drupal module to minify CSS, JS and HTML and reduce load time.

In addition to these, we enabled Redis, used as a database, cache and message broker, so that it can be used as the backend instead of MySQL. This allowed cached items to be retrieved swiftly and improved performance.

Project outcome

On testing the performance metrics on tools like PageSpeed Insights and Pingdom, we witnessed significant improvement.

PageSpeed Insights

  • Result on handheld devices
Pre-implementation (Live Instance)

 

Post-implementation (Live Instance)

 

  • Result on Desktop
Pre-implementation (Live Instance)

 

Post-implementation (Live Instance)

 

Pingdom

Pre-implementation Pingdom Score (Live Environment)

 

Post-implementation Pingdom Score (Live Environment)

 

Conclusion

Speed can be the determining factor in the amount of time an online user spends on your website. It’s important that you remove the sluggishness from your website and inculcate betterments in its performance. Drupal 8 can help by incorporating wonderful features to make your site a high performing space.

Feel free to reach us at hello@opensenselabs.com for developing a high performing Drupal website

blog banner blog image Performance Optimisation Web Performance Performance Budgeting Website Performance Optimisation User Retention Conversion Rate User experience Page Load Speed Page Load time Blog Type Articles Is it a good read ? On
Categories: Drupal

wishdesk.com: Integrating Drupal 8 with Marketing Tools

30 May 2019 - 4:36am
The team at WishDesk explores the most popular marketing automation tools that integrate with Drupal 8.
Categories: Drupal

TC Drupal News: Volunteers still needed for Twin Cities Drupal Camp

29 May 2019 - 12:13pm

Twin Cities Drupal Camp is coming up very soon, and we have some great trainings, sessions, and more planned. But TCDC doesn’t happen by itself — it runs on volunteers who give a little time and effort to make the camp run. People just like you. Volunteering to help with camp operations is another great way to contribute to Drupal. So what do we need help with?

Thursday: before camp set up and registration Friday: before camp set up, staff registration desk, count room attendance, start /stop session recorder, help with party setup and take down Saturday: help guide unconference groups

So if you’d like an easy way to contribute to Drupal, volunteer to help during camp. Can we count on you?

Use the contact form to sign up: https://2019.tcdrupal.org/contact and indicate when and how you‘d like to help.

Categories: Drupal

Drupal core announcements: Francesco Placella (plach) to become full-fledged Framework Manager

29 May 2019 - 8:18am

I'm pleased to share that Francesco Placella (plach on Drupal.org) is moving from a "provisional" core committer to a full-fledged framework manager. (Read more about Drupal core's governance structure.)

Francesco has been a member of the Drupal community for over 11 years. He contributed an incredible amount to multilingual efforts, the Field and Entity API, and was a top contributor to the Drupal Association's D8 Accelerate program, so you can also thank him for Drupal 8 getting released. :slightly_smiling_face:

This experience has given Francesco an extremely well-rounded knowledge of Drupal's API underpinnings, making him a perfect candidate for Framework Manager. He is also extremely meticulous in his patch reviews, and always willing to jump in on problems to help others.

The rest of the committer team all were extremely happy to recommend his promotion to full-fledged committer, so please join me in formally welcoming plach to the team!

Categories: Drupal

Ben Marshall: Change Drupal 7 Menu List Class & Attributes — The Drupal Way!

29 May 2019 - 7:14am

Have a few menus on your site & looking for a quick way to add or change the menu classes and attributes? Use the theme_menu_tree__[menu_name] override in your theme’s template.php file to change Drupal 7 menu list class and attributes:

// template.php /** * Override theme_menu_tree(). */ function theme_menu_tree($variables) { return '<ul class="menu">' . $variables['tree'] . '</ul>'; } /** * Override theme_menu_tree__[menu_name](). */ function theme_menu_tree__main_menu($variables) { return '<ul class="menu">' . $variables['tree'] . '</ul>'; }

The code above will allow you to easily change all menu ul classes and other attributes or just the main menu’s ul classes and attributes.

Looking for a module to change Drupal 7 menu list class & attributes?

Unfortunately, I haven’t been able to find one that handles the individual menu ul instances cleanly, but the Menu Attributes module is a start. It gives users the ability to set the following attributes for each menu item — this does not help with setting the ul classes & attributes:

  • id
  • name
  • target
  • rel
  • class
  • style
  • accesskey

What about Drupal 8? Check this out article out by Tamas Hajas: Drupal 8 Twig: add custom CSS classes to menus (based on menu name).

Related Articles

The post Change Drupal 7 Menu List Class & Attributes — The Drupal Way! appeared first on Ben Marshall.

Categories: Drupal

Pages