Still on Drupal 7? Security support for Drupal 7 ended on 5 January 2025. Please visit our Drupal 7 End of Life resources page to review all of your options.
The theme development forum was created to aid those who are developing themes for Drupal. This forum is not for issues you may be having with contrib themes. Issues with contrib themes should be placed in the issue queue of the theme in question. Please respect this.
If you you have drupal installed already and are seeking a theme, have a question about a specific theme and what it does or if it will fit your use case, please place your questions in the Post installation forum.
I've started on a new theme (generated from stable9 with the drush command), and everything else seems to be working, except the main navigation doesn't display when I place it in the primary menu region. In fact, nothing in that region displays despite it being defined in the yaml and twig templates. However, they display properly when I drag them into header. This is true on all pages.
I need to disable a script on the /user/login page.
I use the following condition to load an analytics script for anonymous users, but my own hits on the login page are, inevitably, being recorded and they are skewing the average page view times downwards.
{% if not logged_in %}
<script async src="https://scripts.simpleanalyticscdn.com/latest.js"></script>
{% endif %}
I would like to replace the impersonal default message which is shown to anyone who submits a comment, but my research has not found a working solution.
The String Overrides module is the obvious go-to, but is not compatible. I found a suggestion to edit settings.php, so I tried the following code in my local test site…
I've searched for this for a while now but found very little info about it. If you have a field which shows the selected value from a select input, and you want to use the key (ie. the machine name of each option value) as a unique class in the output, how can we do it? Is it possible, even?
I'm trying to override the block template for a specific block generated from a view.
I'm using block--[module]--[delta].html.twig to name the template but can't seem to get the template to work after clearing cache.
It's the delta bit im struggling with - I can target all views blocks using block--views.html.twig perfectly fine, but I just want to target a certain block, not all views blocks.