From 1ae67353f2c497614ba5b83c30fe856f13e793d9 Mon Sep 17 00:00:00 2001 From: Oliver Davies Date: Fri, 26 Nov 2021 18:13:29 +0000 Subject: [PATCH] chore: add local link styling Refs: #441 --- .../block--opdavies-local-tasks.html.twig | 37 +++++++++++++++++++ .../templates/menu-local-tasks.html.twig | 21 +++++++++++ 2 files changed, 58 insertions(+) create mode 100644 web/themes/custom/opdavies/templates/block--opdavies-local-tasks.html.twig create mode 100644 web/themes/custom/opdavies/templates/menu-local-tasks.html.twig diff --git a/web/themes/custom/opdavies/templates/block--opdavies-local-tasks.html.twig b/web/themes/custom/opdavies/templates/block--opdavies-local-tasks.html.twig new file mode 100644 index 0000000..7162515 --- /dev/null +++ b/web/themes/custom/opdavies/templates/block--opdavies-local-tasks.html.twig @@ -0,0 +1,37 @@ +{# +/** + * @file + * Theme override to display a block. + * + * 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() + */ +#} + + {{ title_prefix }} + {% if label %} + {{ label }} + {% endif %} + {{ title_suffix }} + {% block content %} + {{ content }} + {% endblock %} + diff --git a/web/themes/custom/opdavies/templates/menu-local-tasks.html.twig b/web/themes/custom/opdavies/templates/menu-local-tasks.html.twig new file mode 100644 index 0000000..07bac4c --- /dev/null +++ b/web/themes/custom/opdavies/templates/menu-local-tasks.html.twig @@ -0,0 +1,21 @@ +{# +/** + * @file + * Theme override to display primary and secondary local tasks. + * + * Available variables: + * - primary: HTML list items representing primary tasks. + * - secondary: HTML list items representing primary tasks. + * + * Each item in these variables (primary and secondary) can be individually + * themed in menu-local-task.html.twig. + */ +#} +{% if primary %} +

{{ 'Primary tabs'|t }}

+
    {{ primary }}
+{% endif %} +{% if secondary %} +

{{ 'Secondary tabs'|t }}

+
    {{ secondary }}
+{% endif %}