What every Drupal website should have from the start

When you install Drupal it comes with some core modules, but overall the functionality is lacking in terms of what every Drupal website should have. This blog post fills that gap.
Robert Roose
Door Robert Roose

What every Drupal website should have from the start

I have been building Drupal websites for more than 15 years and it’s safe to say that I created more than 50+ Drupal websites. I noticed that the process of installing a Drupal website, adding the required modules and configuring functionality became repetitive. So I decided to create a Drupal instance with everything baked in from the start.

If I repeat an action, such as installing and configuring a module, for the multiple websites I'm building I add it to my master Drupal instance. Whenever I start building a new Drupal website I will make a duplicate of this instance, saving me a lot of time. What follows are all the elements currently in this Drupal instance.

Work faster in the backend

One of the first things you want to do after installing Drupal is to add the Admin Toolbar module. This will extend the functionality of the default admin menu with a dropdown, making it easier to navigate to the different areas of the backend.

I also like to install the Coffee module. When this is installed you can press ALT+D to initiate a popup where you can search for a certain area within the Drupal backend and directly navigate to it.

Make it easier to create and edit content

By using the Linkit module you can create links in your nodes to other nodes with an autocomplete reference field. Another advantage is that it will use an aliased path (instead of node/id). When the path of the linked node changes this will be updated automatically.

Next to this you want to add the Editor Advanced Link module. This will give you extra options when creating links within your node. Such as adding an ID, CSS class or you can determine if this link needs to be opened in a new window.

An option to add date fields to your nodes is included within Drupal core. This date field is missing some functionality which is covered by the Smart date module. With the Smart date module you can do things such as setting all day events, create recurring events and set the duration of an event.

When you are creating or editing a node you want to save your node regularly not to lose any content. Saving a node redirects you to the node view on the frontend, but most of the time you want to continue to edit the node. By using the Save and edit module an extra button Save and edit will be displayed next to the Save button. Using this button to save your node, will redirect you back to the editing screen of node, saving you some time.

One of the most helpful modules of the last few years has to be the Paragraphs module. Instead of putting all your text into one big body field you can now create separate paragraphs. These paragraphs can easily be added, deleted or reordered giving you more flexibility creating your content. You can create different paragraph types containing or reusing custom fields.

In my setup I use four different paragraph types:

  1. Text: Is used to place text just like you would in a body field
  2. Media: Can be used to place media such as images, video’s or remote videos which are referenced with the Media library (which I will come back to later in this post)
  3. Block: References any block available in Drupal. Handy when you want to display a block generated by Views. Beware you also need to install the Block field module.
  4. Form: References any webform within your Drupal website. Mostly used to add a form (such as a newsletter signup) between text paragraphs

Now you can build your content by alternating between different paragraph types. A node could look like this:

  • Text paragraph
  • Media paragraph
  • Text paragraph
  • Form paragraph
  • Text paragraph
  • Block paragraph

Optimizing your Drupal website for Search engines

Out of the box Drupal can use some help when it comes to SEO. One of the most impactful things you can do is installing the Pathauto module. With this module you can automatically generate URLs for all your nodes that make sense. So instead of node/34 your node can also be viewed with a prettier URL such as services/hosting. You can create patterns to generate these paths based on tokens. 

The patterns I always use to generate the paths are as follow: 

  • I start with the plural of the content type. If the content type is named article, the first part of the path will be articles. The second part will be the title for which you can use the following token [node:title].
  • There are some exceptions such as nodes of the Page content type which only need the [node:title] as URL. Pages such as contact or the privacy statement for example.
  • In some cases you can extend the URLs by adding a token for a field that is referencing another node or taxonomy term. A good example is an Article content type that refers to a taxonomy term that is used as a category. The pattern would then be: articles/[node:field_category]/[node:title]. Adding this extra category in the URL can also boost your SEO.

Next you want to install the Metatag module. With this module you have more control over the meta tags that will be used in the HTML of your nodes. These meta tags can be used by search engines (such as Google) or social media networks (such as Facebook and Twitter) to display your content. Do note that meta tags keywords aren’t relevant anymore, because they were frequently abused as SPAM. So it’s not worth the hassle to add them to your nodes. Also, even though you enter a meta tag description, Google may still use other parts of your content to display in the search results.

Another thing that can boost your SEO is by using the XML Sitemap module. This module creates an up to date XML sitemap with paths to all the nodes in your websites. Every time you publish a new node this will be automatically included in the sitemap. This sitemap can then be used by SEO services such as Google Search Console to crawl your website. Using the XML sitemap instead of relying on the old fashioned way of crawling (waiting for a bot to visit your website) means your content will be visible faster within the search engine results. 

Sometimes you have pages that don’t need to be included in the search results. Such as profile pages of users or content that’s only referenced by other content. In that case you can use the Rabbit Hole module to determine what needs to happen when a visitor (or search engine bot) visits such a page. You can either show a 404 or a 403 error. Or you can redirect the user to another page. This can be done based on content types, users, taxonomy terms, files, media, etc. You can also determine this on a node by node basis.

How to work with images and video

Packed with Drupal core comes the great Media module. The only thing you need to do is to enable it after installing Drupal. With the Media module all your images and videos become their own entity. Meaning you can reference the same image or video when you want to display a media element. So if you want to reuse an image for multiple nodes, you can now easily select it instead of needing it to upload twice. This saves hassle and space on your server. Learn how to set up the Media module correctly.

Improve the theming capabilities of your Drupal website 

It’s best to start off with a very basic starter theme. This way you can start theming immediately. Here you can learn more about the theme I always use at the start of every new Drupal project.

If you want more control over how to style different blocks you can install the Block Class module. This module gives every block an extra input field which you can use to add one or multiple CSS classes. In your stylesheet you can create reusable classes which saves you work (and time) because you don’t need to target every block individually by ID.

Another thing you can do, to make your theming life easier, is by installing the Link Attributes widget module. After installing and enabling this module you will get the option to give menu items extra attributes such as a CSS class. Now you have more control over how an individual menu item should be styled, such as a login link.

I already talked about the Paragraphs module above and it can even be more powerful for themers if you add the Classy Paragraphs module. With this module you can assign one or multiple classes to a paragraph, giving you more freedom when it comes to styling your paragraphs. I use it to give editors more control on the maximum width of a paragraph (small, medium, large or full screen). 
Tip: If you patch this module you have more control over what options (paragraph classes) users can choose when creating paragraphs.

What do you always add when you create a new Drupal website?

Let me know by leaving a comment. Or if you have any question about the above you can use the comment section as well.

Don’t forget to subscribe to my Drupal newsletter or Drupal RSS feed.
 

More Drupal blogs for beginners

The content of this field is kept private and will not be shown publicly.

Beperkte HTML

  • Allowed HTML tags: <a href hreflang> <em> <strong> <cite> <blockquote cite> <code> <ul type> <ol start type> <li> <dl> <dt> <dd> <h2 id> <h3 id> <h4 id> <h5 id> <h6 id>
  • Lines and paragraphs break automatically.

Comments

Hi Robert.. I stumbled on to your website trying to figure out how to assign a custom color (facebook blue) to a icon card with a fixed set of colors. I've viewed page source and got the source code and made an basic page and went to source mode and pasted the source code in. At any rate I was trying to figure a way to change one of the default colors to FB blue.
However, I read somewhere on here that you would look at our site(s) and give some feedback. I'm a rookie designer, but have got fairly good at drupal on the website where I work... https://townofdinosaurcolorado.gov/
I do test code at https://townofdinosaurcolorado.gov/test-0 and the top block is what I'm wanting to make custom colors ultimately.
On a side note, I'm going to try to make my own drupal site with these guides, but I'm pretty stuck. I bought a template and I don't have a clue how to add all of the rows and cards modules we have. Here's my personal site I just refered to... https://discovercolorado.us
So having said that, I have more good news a a rookie drupal designer. I just won 4 bids to migrate sites to the colorado.gov platform and I'm trying to build my skills as one site it huge.
Here are two more sitres I built from scratch although I haven't been at Washington County for 9 months and no one really know how to do what I did...
https://washingtoncounty.colorado.gov
And one more from scratch...
https://townofordway.colorado.gov
Sorry this was a lengthy message, but I'm at a crossroads and am starting to make money with these sites I win.
Lastly, this is all of the cms sites currently and you can see mine is better than most...
https://cms.colorado.gov/all-colorado-content-management-solution-sites
Thanks for reading... Jim

Hi Jim,
If you want to get serious with Drupal theming you first need to know the basics of CSS and HTML. Once you've got that covered I advise you to start creating your own Drupal themes instead of relying on already available themes. You can read more about this in my other blog post.

Good luck!