Skip to content

Commit

Permalink
fix: page title of public pages
Browse files Browse the repository at this point in the history
Refs: ODSG-45
  • Loading branch information
orakili committed Aug 24, 2023
1 parent 439219c commit acc22c0
Showing 1 changed file with 51 additions and 0 deletions.
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
{#
/**
* @file
* Theme override to display the node title as a block.
*
* We ignore options to display the block title and we add the page-title
* class to ensure consistent display with the `page title` block on other
* pages.
*
* Note: ideally we'd want to use the `page title` block directly in the
* layout builder but it's been disabled.
*
* @see https://www.drupal.org/project/drupal/issues/3029819
* @see https://www.drupal.org/project/drupal/issues/2938129
*
* Available variables:
* - plugin_id: The ID of the block implementation.
* - label: The configured label of the block if visible.
* - configuration: A list of the block's configuration values.
* - label: The configured label for the block.
* - label_display: The display settings for the label.
* - provider: The module or other provider that provided this block plugin.
* - Block plugin specific settings will also be stored here.
* - content: The content of this block.
* - attributes: array of HTML attributes populated by modules, intended to
* be added to the main container tag of this template.
* - id: A valid HTML ID and guaranteed unique.
* - title_attributes: Same as attributes, except applied to the main title
* tag that appears in the template.
* - title_prefix: Additional output populated by modules, intended to be
* displayed in front of the main title tag that appears in the template.
* - title_suffix: Additional output populated by modules, intended to be
* displayed after the main title tag that appears in the template.
*
* @see template_preprocess_block()
*/
#}
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
<div{{ attributes.addClass(classes) }}>
<h1 class="cd-page-title">
{% block content %}
{{ content }}
{% endblock %}
</h1>
</div>

0 comments on commit acc22c0

Please sign in to comment.