Smart Systems for Home

Plain how-to guides for smart home, security and home Wi-Fi

Install Drupal Theme & Configure Blocks: Step-by-Step

· 7 min read · Home Tech

In this article
  1. What You'll Need
  2. Step-by-Step
  3. Common Mistakes
  4. Tips
  5. Troubleshooting
  6. Frequently Asked Questions

To install a Drupal theme and configure blocks, you need to add the theme files to your site, enable it as the default, and then place blocks (like menus, forms, or custom content) into regions (header, sidebar, footer) via the Block Layout page. This guide walks through the entire process using Drupal's standard admin interface, which works for both Drupal 8, 9, and 10 (the steps are nearly identical).

What You'll Need

  • A Drupal site where you have administrative access (user with the 'Administer blocks' and 'Administer themes' permissions).
  • Access to the server's file system (FTP/SFTP or hosting file manager) to upload the theme, OR the ability to install via the Drupal admin's 'Install new theme' page (requires the site to have internet access and proper file permissions).
  • The theme you want to install, downloaded as a .zip or .tar.gz archive from a trusted source like Drupal.org or the theme's official site.
  • If the theme requires additional modules (e.g., a page builder or a specific library), you'll need to install those first—check the theme's README or info file.

Step-by-Step

  1. Back up your site. Before making any changes, take a full backup of your files and database. This is critical because a broken theme can make your site inaccessible. Most hosting providers offer one-click backups, or you can use a module like Backup and Migrate.
  2. Download the theme. Go to the theme's page on Drupal.org (or the official site) and download the recommended release. Make sure the version matches your Drupal core version (e.g., Drupal 10 themes won't work on Drupal 8).
  3. Upload the theme via FTP or the admin interface.
    • Option A (FTP): Connect to your server and upload the extracted theme folder (e.g., mytheme) to /themes/contrib/ (if it doesn't exist, create it) or /themes/custom/ for custom themes. The folder must contain a .info.yml file.
    • Option B (Admin): Go to Appearance (in the admin toolbar, under 'Extend' or 'Appearance'). Click 'Install new theme' at the top. Either upload the .zip file or paste the URL from Drupal.org. Click 'Install'. Wait for the confirmation message.
  4. Enable the theme. After installation, go to Appearance (admin/structure/themes). You'll see the new theme listed under 'Uninstalled themes'. Click the 'Enable' link. Then, to make it the default for your site, click the 'Set as default' link (or check the radio button next to it and click 'Save configuration').
  5. Clear the cache. After enabling, go to Configuration > Development > Performance and click 'Clear all caches'. This ensures the new theme's CSS and JS are loaded.
  6. Check the theme's regions. Go to Structure > Block layout. This page shows the theme's regions (e.g., Header, Content, Sidebar first, Footer). The region names come from the theme's .info.yml file. If you don't see your theme's regions, make sure the theme is set as default.
  7. Configure blocks. On the Block layout page, you'll see a table with regions as columns and blocks as rows. To place a block (like 'Main navigation' or 'Powered by Drupal'), click 'Place block' next to the region where you want it. A dialog opens with a list of available blocks. Select one (e.g., 'Main navigation') and click 'Place block'.
  8. Configure the block's settings. After placing, you'll see a configuration form. Set the 'Block title' (or override it with a custom title), and under 'Visibility settings', you can restrict the block to specific pages, content types, or roles. For example, to show the block only on the front page, select 'Show for the listed pages' and enter /node (or the front page path). Click 'Save block'.
  9. Reorder blocks. On the Block layout page, you can drag blocks up/down within a region using the crosshair icon on the left. The order determines vertical stacking. After dragging, click 'Save blocks' at the bottom.
  10. Disable or remove blocks. To remove a block, click the 'Remove' link next to it. To disable it temporarily, click 'Disable' (it stays but is not shown). To change a block's settings later, click 'Configure'.
  11. Test your site. Visit your front page and a few internal pages to see if the theme and blocks render correctly. Check mobile view (resize your browser) to ensure the responsive layout works.

Common Mistakes

  • Uploading the wrong folder. Many themes come in a zip with a parent folder containing the actual theme. You must upload the folder that contains the .info.yml file directly into /themes/contrib/—not the parent folder.
  • Not clearing cache. After enabling a theme, old CSS/JS can linger. Always clear caches.
  • Placing blocks in the wrong region. If a block doesn't appear, it's often because it's placed in a region that is not rendered on the page (e.g., a 'Footer' region that is empty in the theme). Check the theme's documentation for region names.
  • Forgetting to set the theme as default. Enabling a theme makes it available but not active. You must explicitly set it as default.
  • Ignoring core version compatibility. A theme built for Drupal 9 may not work on Drupal 10. Always check the 'Compatible with' section on Drupal.org.

Tips

  • Use a sub-theme if you plan to customize the theme's CSS or templates. This prevents your changes from being lost when the theme updates.
  • For block visibility, use the 'Content type' condition to show blocks only on specific article or page types—this is more precise than page paths.
  • If the theme provides its own blocks (e.g., a social media block), they will appear in the 'Place block' list. Look for names starting with the theme's name.
  • Use the 'Region indicator' on the front end (if the theme supports it) by adding ?theme= or using the 'Show region indicators' option in the block layout page (available in some admin themes) to see where regions are.
  • Always test with a maintenance page if you're making major changes—you can set the site to maintenance mode under Configuration > Development > Maintenance mode.

Troubleshooting

  1. Theme doesn't appear in the list after upload. Check that the .info.yml file is valid (no syntax errors). The theme folder must be readable by the web server (permissions 755 for directories, 644 for files). Clear the cache again.
  2. White screen (WSOD) after enabling theme. This usually means the theme is incompatible or has a PHP error. Immediately revert to a previous theme by editing the system.theme.yml file in sites/default/config/ (or via Drush: drush config-set system.theme default your_previous_theme). Then check the theme's error logs.
  3. Blocks not showing in the expected region. Go to Structure > Block layout and confirm the block is placed in the correct region. Also, check the block's visibility settings—maybe it's hidden on the current page. Clear the cache.
  4. CSS/JS not loading. Clear the cache, and check the theme's .info.yml for any missing libraries. Also, ensure the theme's folder is not missing files (e.g., if you uploaded only part of the theme).
  5. Cannot install via admin because of file permissions. If you get a 'Unable to install' error, you may need to write to the /themes/contrib directory. Set it to writable temporarily (e.g., 777) and then revert to 755 after installation.
  6. Block configuration changes not saving. Ensure you click 'Save block' at the bottom of the configuration form, not just the 'Save' button on the block layout page. Also, check for JavaScript errors in your browser console that might prevent the form from submitting.

Frequently Asked Questions

Can I install a theme without FTP access?

Yes, if your site has internet access and the server can write to the themes directory, you can use the 'Install new theme' button in the Appearance page. If that fails, you can use Drush (drush pm:install theme_name) or Composer (composer require drupal/theme_name).

How do I make a block appear only on the front page?

In the block's visibility settings, select 'Show for the listed pages' and enter /node (if your front page is the default node page). Alternatively, use the 'Front page' condition if available, or use the PHP code visibility (advanced) with drupal_is_front_page()—but that's not recommended for beginners.

What is a block region?

A region is a defined area in your theme's layout (e.g., 'Header', 'Sidebar', 'Footer') where blocks can be placed. Each theme defines its own regions in its .info.yml file.

Can I have different block layouts for different pages?

Yes, by using the 'Visibility settings' on each block. You can specify which pages, content types, or user roles see the block. For more complex layouts, consider the Context module or the Layout Builder module (core in Drupal 9+).

Why is my block not showing even though it's placed?

Check three things: (1) the block is placed in a region that is visible in the theme's template, (2) the block's visibility settings are not hiding it on the current page, (3) the block is not disabled (look for a 'Disabled' status in the block layout table).

How do I change the order of blocks?

On the Block layout page, drag the block's crosshair icon up or down within its region. Then click 'Save blocks' at the bottom. The order is top-to-bottom.