All RPGs and Storygames by Tod Foley are now available at DrivethruRPG and RPGnow. Bring these games to your table!
In this blog, we will talk about the best practices which will help you enhance your user experience from good to better and how Drupal 8 can be a game changer in this quest.
Often we have heard how Drupal is not for beginners. While setting up a Drupal website has become a lot easier with Drupal 8.6, a good website is not just about setting up some web pages under a single domain name.
Google processes over 3.5 billion searches per day. A stale site, which is not usable or loads very slow and you risk leaving your potential customers frustrated and reflects poorly on your business. While maintenance should never be out of the plan, investing in some good practices can result in the longevity of your website and business alike.
8 Best Drupal Practices
Here are some of the best Drupal web development practices to ensure your website is as much providing a great user experience as it helps you rank your content on Google page 1.
Creativity isn’t alone when it comes to considering, there are many other factors which can influence your reputation in the online market.Drupal’s Architecture
A healthy architecture will not only ensure the demands of different stakeholders is met, but also that the site remains robust for future initiatives as well.
Make your architecture robust.
On a basic level, your content structures must include all the fields and content types. A clean content architecture not only helps ensure good performance but a great user experience, and easier maintenance too.Although a well-maintained website is critical, you can’t do much if the base is full of errors.
Less is always more.
In your development plan choose limited content types and fields so as not to confuse your content creators. Drupal is a powerful tool for displaying content in different formats, languages, and screens.
Configuration plays an important role in architecture.
In simple words, configuration is the collection of settings of how the default site functions for the admin as against the popular notion of the placement of content on the website. It includes site name, the content types and fields, taxonomy vocabularies, views and so on.
You can also check out this video by Pantheon on Drupal 8 architectural practices.
Site configuration data in Drupal is consistent, everything from the list of enabled modules, content types, taxonomy vocabularies, fields, and views can be done easily.
Your approach must be flexible.
In the basic level, you must use a new entity type for different types of data. In case of similar data types, use bundles for a single entity type. However, for modules, they are designed to work with Nodes, and not other entity types.
Using nodes is easy, as it allows to create a new content type through the admin interface without much coding against the case of creating entities which require coding. As a developer, your approach should be flexible.
Bonus tip: Don’t make configuration changes on a live site without testing them locally.Check the Codes
We all know how good coding helps improve quality and get better results. Basics should be to start with simple codes. Remember, it is always difficult to modify complicated codes in the future. Thus, you should keep your coding simple for the longer run.
Drupal coding standards are version-independent and "always-current". All new codes follow the current standards, regardless of (core) version. In case you want to update existing code for the current standards, always create separate and dedicated issues and patches instead of squeezing into unrelated patches.
Remember to use US English standards for spellings in your code, which means it will be "color" not "colour".
Here are the top 6 coding practices by Drupal.org:
- Use an indent of 2 spaces, with no tabs and the lines, should have no trailing whitespace at the end.
- All binary operators (operators that come between two values), such as +, -, =, !=, ==, >, etc. should have space before and after the operator, for readability.
- Control statements should have one space between the control keyword and opening parenthesis, to distinguish them from function calls. Control structures include - if, for, while, switch, etc.
- All lines of code should not be longer than 80 characters. Lines containing longer function names, function/class definitions, variable declarations, etc are allowed to exceed 80 characters. Conditions should not be wrapped into multiple lines.
- Arrays should be formatted using short array syntax with a space separating each element (after the comma).
- When unconditionally including a class file, use require_once(). When conditionally including a class file, use include_once(). In either case, it will ensure that class files are included only once.
You can use Coder for coding standards validation without loading Drupal.Infrastructure
Infrastructure covers the stack your website lives on, including the server, the database, and any software layers, such as Varnish or Memcached, which ensure your visitors have a snappy experience. Planning the infrastructure from the start and developing in the same environment can greatly reduce variables and risk at launch time.
Having reliable multiple environment configurations and a solid disaster recovery plan shouldn’t be left to last-minute decisions. When it is, mistakes start arising. Here are a few tips to avoid the most common errors.Best Practice:
- Size your stack correctly, not too large, not too small. This can ensure you’re economically prepared for anything.
- Bottlenecks can arise from the hardware or from processes hogging memory.
- Check logs for errors and prepare for growth and spikes. Your stack is only as fast as the slowest component. Focus your efforts there; you’ll probably find low hanging fruit.
- In terms of security, it’s crucial to configure to protect from internal attacks as well as external attacks
The frontend is more than just theming.
While the features and their functioning depends on the backend, the usability and aesthetics depend on how well the frontend is taken care of.
Performance of the website is shouldered equally between both.“..powerful, adaptable, accessible, clear, concise, natural.”
Quickly brushing up the basics, here’re the best Drupal frontend practices:
- Define component elements (sub-objects) using their own classes. This is to avoid relying on markup structure and overly-generic class names, prefixing them with the component’s name followed by two underscores.
- Thoroughly exercise and test your site and resolve any PHP errors that are displayed during theming development.
- Use a stable administrative theme during development.
- Use DRY CSS and group reusable CSS properties together. Name these groups logically.
- Name components using design semantics. HTML elements already impart semantics on the content and machines cannot derive content-level semantics from class names.
- In order to reduce the load on the frontend performance of your website:
- Enable gzip compression
- Use lazy loading for site assets
- Keep Inline background images under ~4KB in size
- Remove unused CSS
- Use efficient CSS selectors
- Download 3rd party scripts asynchronously
- Use SASS to keep your responsive design more organized
It is very important to keep the quality of your website an utmost priority before you move on to other technical stuff. While this might feel like a lot of work for your lot to do, it can make an actual difference. A review by your peers (is a must) will help you get an additional idea of how things look and should work.Successful regression testing gives you the much-needed confidence.
It is also very important that you keep an eye on previous things while adding new stuff. The testing framework PHP unit is inbuilt in Drupal 8. By setting up the testing environment, websites can be tested easily (as samples of test cases which have been written by the community are already available).
Drupal has a very active community support. With almost 1,00,000 active developers who write test cases (which are later merged into Drupal) and submit solutions. With this, you can say that Drupal is quick in providing you with solutions to your problems.Aim for Google Page 1. Don’t Forget the SEO
75% of users don’t even click past the first page!
Starting with the search, it is very important that the user gets the best results in her first search. Now, as a user, you must have tried different keywords in an attempt to connect to the content of your website. Here comes the art (and science) of SEO.
Drupal offers a suite of SEO modules. However merely deploying the modules isn’t enough, it is important to configure and enable them as well.
The SEO best practices include:
- Using Robots.txt, so the right pages and information is indexed.
- Ability to customize page titles and metadata. Also, it should be capable of automatically populating these respective fields as per SEO norms and best practices.
- Navigational drop-down menus are crucial internal link structures, silently contributing to search engine optimization. They establish relevancy and hierarchy across your website to help search engines index them in from the beginning of time. It should also provide easy customization of navigation menus.
- URL aliasing must be enabled with Pathauto as it ensures the search engine understands what the webpage implies.
Security is a vast area of expertise and it is quickly changing with time. While the list of do’s and don'ts is extensive and exhaustive to keep up with the threats, vulnerabilities and mitigation strategies, here are the best Drupal security practices to follow in order to keep up the health and security of your website.
- Keep your core updated: A key practice, keeping the core updated will always be the first when listing healthy security practices. Always look out for core updates (include the minor releases as well). In all of its advisories, the Drupal Security Team asks for updating the core version of the system.
- Use additional security module: When covering security, there is nothing as better than equipping yourself with more and more. To keep the walls up high, you can use the additional security modules like security kit, captcha, and paranoia. Drupal Security Review can be used as a checklist to test and check for many of the easy-to-make mistakes making your site vulnerable.
But use only security team approved modules: Your site probably uses a number of contributed modules, although that’s not an issue. Using the stable and approved modules is where the key lies. This is especially worth noting for contrib modules which are more susceptible to vulnerability.
Always look out for the green batch when downloading a contrib module. Rest, as the advisory reads, Use it at your own risk!
Keep Up your Backup: As an administrator, you have to be prepared for all uninvited events.
Drupal’s open-source basics give it a possibility that it is updated frequently with more and better security modules.Maintenance Practices
The life cycle of a website begins from initial plans and extends to the end of the site. The site exists in three different phases: development, deployment, and maintenance. After the site is launched, your website lifecycle practices become critical to the success of changing and maintaining your site.
- Keep your code under version control.
- Maintain separate environments for the different stages of the site, and keep them up to date.
- Restrict access to the production site for all but the most trusted users.
- Review all logs periodically, including Apache, Drupal, and MySQL.
- Review and assess your architecture periodically, and plan for the future.
At OpenSense Labs, we understand how important your website is to you. Reach out to us at firstname.lastname@example.org to get a holistic view on how to enhance your user experience.blog banner blog image Drupal 8 Drupal practices Blog Type Articles Is it a good read ? Off
Online stores open unlimited opportunities with no geographical boundaries. Behind their lines of code are successful purchases, great profits, and happy customers. So online stores should be reliable, efficient, and attractive in everything — from product catalog to e-commerce checkout. An awesome choice for building an online store is Drupal 8, particularly with one of its greatest treasures — Drupal Commerce 2.x. Let’s explore Drupal Commerce 2.x features for your Drupal 8 online store in more detail.
Here is a very quick and simple example of how to create an administrator on any drupal 7 website using drush command. This tweak is very useful when the client has provided a site for support but forgot or did not have the opportunity to create an admin account for you.So you don't need to hack in your code,just run a drush command will create an admin account for you.
This Module prevents field machine name from ending (_) underscore. For example,
when you have brackets at the end of a label, e.g., "Address (2)",
you end up with a trailing "_" character — field_address_2_.
Perhaps, you simply want to validate field the machine name, especially when it
is ending with underscore or having two/more undersocre and it has been
On the first post of this series “Improving Drupal and Gatsby Integration - The Drupal Modules”. I introduced two contributed modules we wrote to simplify the Drupal usage while working with Gatsby. One of the modules mentioned was `tui_editor` a WYSIWYG markdown editor integration with the Toast UI Editor project. This module allows content editors to enter content as markdown, making easy to implement JSON-API endpoints that return markdown.jmolivas Fri, 12/07/2018 - 08:00
Drupal module that provides a dynamic read more link and body text.
It acts like the core Summary or Trimmed Text formatter, except that when its output is not the full body it adds a read more link. This makes it possible for the site builder to create a teaser style which only shows "Read more" when there is more to read.
This formatter is only suited to simple content types which have a single long text field. It's more of an proof of concept than a fully fledged module at the moment.
Have you ever heard the one about the web developer who goes in to make one last change to the site at 4:45PM on a Friday afternoon? It is SUCH an easy fix--he can get it done and go home for the weekend with his head held high. Ah, what a relaxing weekend it will be! Cleaning out the gutters, hiking with the kids, and really just taking some "me time". As it turns out, that plug-in update was not well-architected. As a result, it impacted the structure of the site--and now all of the content is right-justified. WHAT JUST HAPPENED?DevOps Drupal Planet Visual Regression Testing
Provide tools for AMP validation.
Project is currently still in a very early stage of development!
In September of this year I was privileged to be asked to serve as the Interim Executive Director for the Drupal Association, after Megan Sanicki's departure to her next adventure.
At that time, the Drupal Association board announced the formation of a search committee, to begin the process of finding the Drupal Association's next leader in earnest.
That search committee consists of the following members:
- Adam Goodman (board chair)
- Baddy Breidert (board member)
- Dries Buytaert (project founder)
- Tiffany Fariss (former board member)
- Tim Lehnen (Interim ED)
- Jacob Redding (board treasurer)
This search committee has engaged the services of Lehman Associates, an internationally recognized executive recruiting firm. Working closely with the executive search committee and the board as a whole, Lehman Associates has developed a position profile for the Drupal Association's next leader.
Please feel free to share this position profile with individuals you believe would be good candidates for Drupal Association leadership. If you are interested in putting your own name forward, please use the contact information listed at the bottom of the profile.
Interested parties should submit their candidacy no later than January 15th, 2019.
The search committee is excited to work together with the Lehman team to develop our pool of candidates as we go into the new year!
On December 5, 2018, the Drupal Association Board met online for their regular Fall/Winter board meeting.
You can find the official meeting minutes and board packet on the Board Meeting Minutes and Materials page of the Drupal.org website.
Tome Netlify provides integrations between Tome and Netlify, giving you the best static Drupal experience possible.Installation
Tome Netlify depends on Tome's dev release, which includes APIs needed to handle redirects. When beta 2 is released, users can install that release.Use
Tome Netlify provides the following features:
New Google PageSpeed Insights Drupal module - An easy-to-use API Wrapper for Googles PageSpeed Insights. The JSON response is mapped to objects for an headache-free usage.
The module is based on this PHP library.
If I say that in today’s booming social era, having a Facebook or Twitter account is not enough in terms of web presence for your music, you would agree, right?
We all know that having a website for the same purpose, not only delivers a professional impact on the audience but also eliminates the restrictions that these external sites would have.
For instance, you desire to put banners on your site to increase the song sales or wish to provide details about your latest concert to your fans - How do you do it?
Of course, it is only possible if you have your own music website. And there is no better option than Drupal for this task.
If you are thinking that why specifically I am talking about Drupal then you need to know that Drupal is one of those CMSs which is flexible and consists of an excellent API framework that can accommodate almost all conceivable functionalities.Choosing Drupal for your music website
Yes, it is important to unite music composers i.e musicians and bands, with their fans and loved. The sole reason to trust Drupal for this task is only because:It has responsive web designs
There would be a variety of audience for your music website, using different devices. While switching from big screen to small screen, things change. Size of the image is modified, menu items become drop down, columns are pushed around the webpage that makes sense with content being the supreme leader. All of this is easily handled by Drupal.
Every musician wants that his work leads to more word of mouth referrals and that new fans are added to the list every day. A responsive website leads to a better user experience with them spending more time on your site. Moreover, responsive web designs would help the end users to access menu, links, buttons and fill out forms easily. More users mean more traffic. According to statista, 52% of the web traffic is generated from mobile devices.52% means half of the internet traffic, making responsive websites an important aspect of the whole scenario.
There are chances that you might be building a music website for a band. Which means that each member of the band would require an individual site. This is where Drupal is the best option for you. It provides you with the ability to run multiple sites from one single Drupal codebase. Each site has a separate database, however, the projects that are stored in modules, profiles and themes can be installed by all the sites.
Warner Music Group (built on Drupal )is a great example of this. The website manages and creates the web and mobile sites for more than 300 artists and bands. It serves millions of yearly visitors, promotes news, music releases etc.
ABC ( Aliases, Block and Content type)
Your fans need details to keep up with your band’s performance or music concerts. This can be done with the help of multiple addresses or aliases. Aliases provide an option to the end users to find a particular website easily. With modules like pathauto, metatag, redirect you can make your music website search engine friendly.
- Pathauto modules help in automatic generation of URL/path aliases for various kind of content without requiring the end user to manually describe the path alias.
- The Meta tags modules allow you to automatically provide structured metadata for a website. These meta tags help in improving the ranking and display of the site in search engine results.
- Once your website has a lot of content, you may need to audit it. This would include merging and deleting of pages that are no longer in use, and for that, you need to create URLs redirects. The Redirect module lets you create and manage these URLs using a simple user interface.
A block would essentially act like a container that would hold all the content, lists of content, images and can be placed anywhere on the page. For example: if you want the visitors to contact you regarding any collaboration or get information about the latest concerts then the additional field can be constructed with the help of block.
A content type is the collection of data fields grouped together in a logical set to facilitate content entry and display. Drupal core is preconfigured with two content types which allow you to create and save multiple posts. For example: In your music website you might have a content type “concert” that would include individual fields to collect the data about dates, place, price etc. The concert content type could be used to create hundreds of individual concert records.Performance and Scalability
Loading time serves as a major role when it comes to the performance of the website. According to Google developers, 40% of the users abandon a website if it takes more than 3 seconds to load. Thus, making speed a huge factor for the strength of the website.
When it comes to a music website, the factor contributes even more. The visitors of your website definitely need a fast and a swift platform that loads the website quickly, and Drupal by default is the best CMS for this task. Drupal 8 can scale well to millions of users if it is optimized well. A poorly optimized website not only slows down a website but affects the performance as well. Thus to improve and keep up the site performance modules like Blazy and Google analytics are used.
- Blazy module is used to provide its end users with faster load time and helps in saving data usage when they are not browsing the whole page.
- Google Analytics module is a type of web statistics that are used to track and monitor the traffic of a particular website. It comprehends on the links which are being tracked (downloads, outgoing and mailto) by the visitors which are there on your page.
The site has to be easy for you to manage. It is important that formatting of content and adding of images ( without seeing any spooky HTML codes) on your music website is simple and accessible. Drupal provides with modules that would allow you to edit your content the way you want. With drag and drop and WYSIWYG tool content authors/non-developers can create and design pages easily. With the evolution of the Drupal platform, new upcoming layout builder seems even more promising.
Drupal upcoming layout builder which would be stabilized in Drupal 8.7, is unique in offering a single, powerful visual design tool with three use case:
- Use case 1: Layouts for template contents
For the sites that have a significant amount of content, it is important that similar content have the same type of appearance. For instance, you are selling songs from the same album. For your fans, it would provide a consistent experience when browsing the song list, making them easier to differentiate. For content authors, the templated approach means that they don’t have to think about the layout of each song.
Drupal 8's new Layout Builder lets you to visually construct a layout template that will be utilized for each item of the same content type (e.g. a "songs layout" for the "song" content type). This is achievable only because the Layout Builder serves from Drupal's powerful "structured content" abilities.
- Use case 2: Customizing the layouts
Suppose you desire to put a video of your jam sessions on your website and later think of updating a band picture with the video, it may not make sense to add an optional “highlighted video” field with the band picture.
Drupal 8 Layout Builder offers the ability to customize templates layouts on a case per case basis. In the above example, Layout Builder would let a content creator rearrange the layout for just that one band picture and put the video directly below the image.
- Use case 3: Custom Pages
It should be noted that not everything is templated and content authors often need to create a one-off page on “About us”. Drupal 8 Layout Builder can be used to create dynamic one-off custom pages. A content author can begin with a blank page, design a layout with the addition of blocks.Hosting
The Drupal-based website which is specially designed for Lady Gaga witnesses heavy traffic spike every day. The burst in the traffic has to be handled periodically.
Web Hosting provides space that you can buy on a web server to store your website files. When you tend to buy website hosting you basically rent server space on a server where all your files are placed.
Drupal provides you with many websites hosting options. Which are not only safe to use, but it handles your site traffic also. Some of the most popular Drupal based web hostings are:
- A2 Hosting
With a variety of modules in Drupal 8, from enhanced media management to out-of-the-box experience, Drupal 8 is getting stronger with each update. It makes sure that the visitors on your website have a good user experience with no backward compatibility breaks.
With the release of Drupal 8.6, a large number of improvement has been foreseen for content authors, evaluators, site builders, and developers.
For content authors, Drupal has added a support for “remote media type”. In other words, you can easily embed Youtube and other videos in your content.
For evaluators, Drupal 8.6 brought about “out-of-the-box experience” that let them install and test drive Drupal in minutes. They can install with the help of a demo profile that showcases all the capabilities by presenting a beautiful website filled with content right out of the box. This makes it easy for an end user to download and install a fully functional Drupal demo application within minutes.
For the developers, Drupal 8.6 has brought about an API first platform that involves an overview of REST improvements.
Drupal 8.7 has promised to bring even more sophistication the Drupal family. It ensures its end users with:
- Stabilized features that target content author.
- Adding of JSON API (that did not make it to the release of Drupal 8.6) that would allow users to rapidly create and decouple the applications.
- It would present with stable multilingual migrations
- Would continually improve the evaluators' experience.
- Iterate towards an entirely new and unique decoupled administrative experience.
The best part about Drupal is that it provides its end users with a variety of modules that help them to build their website. Some of the modules which you can use for your music website might include:
AudioField module enables you to upload or link audio files and play them on your site using one or many audio players. It has the power to support many audio formats. Currently, the module supports the following audio formats:
- Default HTML5 audio player (which is built-in)
- WordPress Audio
AudioField also supports player libraries and comes with the basic HTML5 audio player.HTML5 is a built-in HTML audio player and requires no additional libraries to be installed
It also supports additional audio player libraries which requires installation before use.
- Audio Embedded Field
Audio Embedded Field module creates a simple field type that enables you to embed audio from SoundCloud and other custom URLs to a field with the integration of media entity module for Drupal 8. You only need to provide URL to the audio and the module creates an embedded audio player.
(It should be noted that this module is not covered by the security advisor)Go Beatles (Case study)
No doubt on the fact that the music of Beatles have created history and has been marked as “evergreen”. With such a wide fan base audience, the website was expected to be more engaging. It needed to promote new albums, merchandise, and events in a way that engaged fans.
Drupal was chosen because of its flexibility and excellent API framework.Goals of the Project
- It was a need for the site to be easy for content editors to manage.
- It was expected that the new articles could be pushed to Facebook.
- The existing users could easily migrate to the new site, along with their prior profile and comments.
- The user experience must be truly responsive and engaging on all devices.
- It was required that the content pages must be built from existing collections of text, quote, image, and audio.
- With millions of fans, it was evident that the site experiences heavy traffic every day.
- Thus it was important that the site was eligible to handle large surges of visitors and traffic spikes.
In terms of presenting an engaging story, one of the creative inspirations of the whole project was “The Beatles Anthology Book”. The key idea was to provide story snippets, images audio clips, videos of the band that allowed an arrangement in a different order. Different content types with the field to accommodate image, audio, video, the text was created. All the snippet of information was tagged using taxonomies and tile width. The story node used Entity Reference, Entity Reference View Widget that allowed the editor to sort vast content and filter it as well.
As regards to theme layer, Drupal highly contributed to the website. The whole website was responsive and demonstrated the actions that had to be done by the editors. The site also depicted that Drupal can cope up with heavy loads and traffic spikes with the help of CDN module that contributed highly to deliver image and file assets via Amazon CloudFront (which was the main concern). Optimized and bandwidth efficient images were also required to deliver a responsive website. Thus, usage of modules like pictures and breakpoint along with some heavyweight template.phpcustomization was done to achieve a perfect theme layer.
Another vital requirement of the site was to tie the site with Facebook for the whole purpose of logging in, registering, and commenting. This was done to promote visibility of the site. Drupal provided with several packages that allowed the website to integrate with Facebook at various levels. With modules like Facebook auto post, Facebook OAuth and Drupal for Facebook the integration was possible. Not only this but feeds and SQL parser module were also used to query the old database.
Thus, without the help of Drupal and its modules, it would have taken an incredible amount of time and money.
Yes, it is important for an artist to have a website that is specifically dedicated to them. Without it, there are chances of you losing out on gigs, promos, press etc. Thus, contributing to your music career and talent, the need for a website is clear.
Drupal here emerges as a helping hand. The CMS would provide you with a collection of modules that contributes to the construction of your website.
At Opensense Labs we present you with services that not only enhance the performance of your website but we also help you in getting close to your dreams by embracing innovative technologies that can be implemented on Drupal framework. Contact us at email@example.com to know how you can build a Drupal-based music website.
Drupal web designs
Responsive web design
Warner Music Group
performance and scalability
Is it a good read ?
This module allows for integration with the Setka Editor - WYSIWYG post builder, a user-friendly editorial design tool for creating beautiful layouts that attract, engage and convert. Installation allows Drupal to replace textarea fields with Setka’s page builder, which makes designing extraordinary editorial content quick and easy.
- Install via /admin/modules
- drush en login_by -y
- composer require drupal/login_by
Provides helpers for entities. Currently a property helper to get deeply nested properties and a original cache to help with postsave hooks concerning paragraphs.
This module does nothing on its own and you should only install it if another module requires it.