LN Webworks: 5 ways to Enhance Customer Experience of Drupal Websites

Image removed.

Customer experience is unarguably the center around which modern businesses are revolving today. Every potential strategy they plan to implement gets filtered through the lens of user experience first. As a Drupal web development company, we recognize the significance of an approach focused on customer needs which can result in increased customer loyalty, enhanced reputation, and greater revenue opportunities.

According to the current state of affairs, user experience is largely dependent upon business websites today. After all, your website is the face of your organization and the medium through which a majority of customers interact with you. Phenomenal user experience is characterized by high-speed, user-friendly, and interactive websites. Cutting-edge content management systems (CMSs) such as Drupal infuse your site with all these phenomenal traits.

LN Webworks: Drupal Websites are Not Good in Terms of Design: The Common Myth

Image removed.

According to research, around 2 billion websites run on Drupal globally. Such a massive appeal has made Drupal the leading content management system (CMS) worldwide. It has captivated the hearts of eminent enterprises with its 42,650 modules and 2,900 themes. As a Drupal Web development company, you can leverage Drupal's top-notch security features to provide your clients with unparalleled cybersecurity. Over the years, the crucible of cutting-edge advancements has forged Drupal’s features to make it unmatchable. It doesn’t matter whether it is a basic website or a content-heavy website, Drupal is packed with capabilities to handle them all.

LN Webworks: How AI is Shaping the Future of Content Management and the Web?

Image removed.

Artificial intelligence is a highly potent technology that has revolutionized the world. As AI continues to gain traction, it's only natural that content management systems (CMS) like Drupal will integrate with this technology. CMS like Drupal can leverage AI-powered tools to provide more personalized content. AI is serving as an empowering center for smart data-driven decision-making, automation, enhancing customer experience, minimizing human errors, and analyzing upcoming trends. If we look into the current state of affairs, artificial intelligence is slithering into the world of content management as well. Experts believe that the future of AI is that it will get so deeply embedded into content management that everything will be driven by it.

ComputerMinds.co.uk: Removing invalid query string parameters passed to a view

Image removed.

As a Drupal site administrator, you may notice in the website logs that there might be a large number of repeated log messages along the lines of "An illegal choice has been detected. Please contact the site administrator." We recently had this problem on a Drupal site that was upgraded from Drupal 7 to Drupal 9 which featured a product search that was built using Views.

Due to slight differences in the way in which the view and facets were built in the Drupal 9 site, this resulted in slightly different URLs being used when the user would filter the search results. For a standard site user who would be interacting with the form elements to filter the view, this was not a problem. However, search engines that had indexed these older URLs from the Drupal 7 site were still trying to crawl the search page regularly, with (what are now) invalid query string parameters.

At the times when the search engines were crawling these pages, this would result in hundreds if not thousands of log messages being logged. Although not anything that would directly impact the users of the site, it’s not ideal to have so many log messages polluting the site logs. Having so many log messages makes it harder to track down and find actual more pressing issues that may need to be addressed.

It makes sense to try and eliminate the cause of this issue and stop so many error messages from being logged. This can be easily accomplished by the following snippet of code which uses hook_views_pre_build().

use Drupal\views\ViewExecutable; /** * Implements hook_views_pre_build(). */ function my_module_views_pre_build(ViewExecutable $view) { if ($view->id() === 'my_view_name') { /** @var \Symfony\Component\HttpFoundation\Request $request */ $request = $view->getRequest(); /** @var \Drupal\Core\Http\InputBag $query */ $query = $request->query; if ($sort_by = $query->get('sort_by')) { // Compare to the list of allowed values to see if it's valid. // If it's not, then remove the sort_by from the query completely. $view_sorts = $view->sort; if (!isset($view_sorts[$sort_by])) { $query->remove('sort_by'); } } } }

 

Let's quickly break down the code example above. For a custom module named my_module, we are implementing the hook_views_pre_build hook inside of the my_module.module file. We then check the view ID of our view to see if it’s the one we are trying to target and then get the HTTP request object from the view, checking the query string values of the request.

The query string value we are interested in (which was causing the error messages) is named sort_by. We get the list of allowed sort values from the view and then compare this to the value in the query string. If the value trying to be used isn’t a valid value for our view, we then unset this from the query.

Of course, if you were looking to target a particular display of the view and not all of them then you’d need to add some additional logic to check the current_display of the view. For example, change the line:

if ($view->id() === 'my_view_name') {  

to 

if ($view->id() === 'my_view_name' && $view->current_display === 'page_1') {  

which will restrict the code block to only run for the page_1 display.

 

 

LN Webworks: Free Drupal 9 Themes for Building Media and Publishing Websites

Image removed.

Did you know that eminent news and media networks such as Al Jazeera, The Economist, the Walt Disney Company, CBS, Time Inc., and Viacom rely on Drupal 9 to support their magnificent websites? The right Drupal 9 theme can help you create an engaging and functional media and publishing websites that stands out in a competitive landscape. If you also run a media and publishing company, this revelation might leave you startled. You may begin to ponder why the top players in the media industry are so invested in Drupal.

Matt Glaman: Drupal module semantic versioning for Drupal core support

A large amount of our time during the Drupal 10 readiness effort was around semantic version discussions. Folks were creating new major versions to add Drupal 10 support while dropping Drupal 9 simultaneously. Technically that follows the semantic versioning guidelines but is a horrible user experience. Users must update the module when they upgrade Drupal core to Drupal 10. Ideally, users could update their modules first and then upgrade Drupal core.

This blog post is taken from part of my talk "Lessons learned from helping port the top contrib projects to Drupal 10." It is also inspired by my coworker Jakob Perry's blog post, "Don’t go making major version changes."