So grab the regions from the core/themes/olivero/ and put them in your new theme info YAML. If you don't then you get a somewhat random order of core regions that won't match the theme you are overriding. We will be looking at regions and adding your own in a later part but even if you are only doing basic overrides to a base theme you need to add the regions in your info YAML. One last step to make your sub-theme work with the parent base theme is to add the regions. Themes that come with Drupal are in the core/themes directory and you are best not to touch these. Nice work! Theme uploaded to Drupal and ready to install.Ī note on the theme folder in the root, this won't be overridden when you make core Drupal updates. To make a child theme you only need a directory named the theme name and then an info file with the same name with the following settings at the least. If you read the top of the file it is suggested to only make minor modifications in child themes to more complex themes such as Olivero as they are in active development and therefore there is a chance of it breaking your overrides at some time in the future. I will keep this straightforward and only override the background. The idea of creating a child theme is at the core of all theme development in Drupal and it is unlikely you will ever build a theme from the ground up, i.e you will at least take advantage of the HTML output by Stable theme.Īs stated we will override the Olivero theme. So let's look at how to create a child theme. The process of creating a child theme is the first step in developing any Drupal theme, even if you start with the most basic theme that comes with Drupal, that being the plain canvas of Stark theme or the hidden base theme of Stable. To override any theme we need to create a child theme, this keeps the parent theme untouched and easy to update in the future. For more on Olivero, you can read about it on, in the strategic initiatives section. I will use Olivero for the demonstration, the new Drupal 9 theme which has some nice features. In this article, we will first look at overriding one of the themes that come out of the box with a fresh Drupal 9 site. This article is a theming primer for someone new to Drupal, it assumes you already have a site set up and you have the ability to upload the theme to the server either using FTP, CLI or can upload via the UI.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |