In the case of our Categories block, we can begin by navigating to the core/modules/block/templates
folder and following these remaining steps:
block.html.twig
and place it into our theme/octo/templates
folder.block.html.twig
to block--views-block--categories-block-1.html.twig
based on the template's suggestions.<h2>
to <h4>
:New markup
{% set classes = ['block'] %} <div{{ attributes.addClass(classes) }}> {{ title_prefix }} {% if label %} <h4{{ title_attributes }}>{{ label }}</h4> {% endif %} {{ title_suffix }} {% block content %} {{ content }} {% endblock %} </div>
Once finished, make sure to save the template, clear Drupal's cache, and then refresh the Blog listing page in the browser. Our Categories block heading is now displayed properly. We have managed to alter the heading of our Categories block, but we still need to modify the output of our categories to display as an unordered list, along with any additional CSS classes we may need. Time to add a Views template.