From d5c58ccf23b64522674c958df375a892d5cab0b4 Mon Sep 17 00:00:00 2001 From: ebremner <ebremner@uwaterloo.ca> Date: Mon, 6 Jan 2020 15:39:13 -0500 Subject: [PATCH] ISTWCMS-3507: adding templates for local site footer --- .../blocks/block--uw-ct-site-footer.html.twig | 38 ++++++ templates/page/page.html.twig | 120 +++++++++--------- .../regions/region--sitefooter.html.twig | 3 + 3 files changed, 102 insertions(+), 59 deletions(-) create mode 100644 templates/blocks/block--uw-ct-site-footer.html.twig create mode 100644 templates/regions/region--sitefooter.html.twig diff --git a/templates/blocks/block--uw-ct-site-footer.html.twig b/templates/blocks/block--uw-ct-site-footer.html.twig new file mode 100644 index 00000000..13dc272d --- /dev/null +++ b/templates/blocks/block--uw-ct-site-footer.html.twig @@ -0,0 +1,38 @@ +{# +/** + * @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() + */ +#} + +{% include "@layouts/site-footer/site-footer.twig" with { + "body": content.body, + "logo_link": content.logo_link, + "logo_url": content.logo_url, + "site_name": content.site_name, + "logo_alt_text": content.logo_alt_text, + "social_media": content.social_media, + "social_media_placement": "local-site-footer", + "primary": content.primary +} %} diff --git a/templates/page/page.html.twig b/templates/page/page.html.twig index b3470312..9e605c8a 100644 --- a/templates/page/page.html.twig +++ b/templates/page/page.html.twig @@ -1,59 +1,61 @@ -{# - /** - * @file - * Theme override to display a single page. - * - * Available variables: - * - * General utility variables: - * - base_path: The base URL path of the Drupal installation. - * - is_front: A flag indicating if the current page is the front page. - * - logged_in: A flag indicating if the user is registered and signed in. - * - is_admin: A flag indicating if the user has permission to access administration pages. - * - * Site identity: - * - front_page: The URL of the front page. Use this instead of base_path when linking to the front page. - * - * Page content (in order of occurrence in the default page.html.twig): - * - node: Fully loaded node - * - * Regions: - * - page.header: Items for the header region. - * - page.highlighted: Items for the highlighted region. - * - page.primary_menu: Items for the primary menu region. - * - page.secondary_menu: Items for the secondary menu region. - * - page.highlighted: Items for the highlighted content region. - * - page.help: Dynamic help text, mostly for admin pages. - * - page.content: The main content of the current page. - * - page.sidebar_first: Items for the first sidebar. - * - page.sidebar_second: Items for the second sidebar. - * - page.footer: Items for the footer region. - * - page.breadcrumb: Items for the breadcrumb region. - * - * @see template_preprocess_page() - * @see html.html.twig - */ -#} - -{% extends '@layouts/site-container/site-container.twig' %} - {% block site_content %} - - {{ page.header }} - - {{ page.navigation }} - - {{ page.breadcrumb }} - - {{ page.highlighted }} - - {{ page.help }} - - <main id="main" class="main" role="main" tabindex="-1"> - {{ page.preface }} - {{ page.content }} - {{ page.postscript }} - </main> - - {{ page.footer }} - - {% endblock %} +{# + /** + * @file + * Theme override to display a single page. + * + * Available variables: + * + * General utility variables: + * - base_path: The base URL path of the Drupal installation. + * - is_front: A flag indicating if the current page is the front page. + * - logged_in: A flag indicating if the user is registered and signed in. + * - is_admin: A flag indicating if the user has permission to access administration pages. + * + * Site identity: + * - front_page: The URL of the front page. Use this instead of base_path when linking to the front page. + * + * Page content (in order of occurrence in the default page.html.twig): + * - node: Fully loaded node + * + * Regions: + * - page.header: Items for the header region. + * - page.highlighted: Items for the highlighted region. + * - page.primary_menu: Items for the primary menu region. + * - page.secondary_menu: Items for the secondary menu region. + * - page.highlighted: Items for the highlighted content region. + * - page.help: Dynamic help text, mostly for admin pages. + * - page.content: The main content of the current page. + * - page.sidebar_first: Items for the first sidebar. + * - page.sidebar_second: Items for the second sidebar. + * - page.footer: Items for the footer region. + * - page.breadcrumb: Items for the breadcrumb region. + * + * @see template_preprocess_page() + * @see html.html.twig + */ +#} + +{% extends '@layouts/site-container/site-container.twig' %} + {% block site_content %} + + {{ page.header }} + + {{ page.navigation }} + + {{ page.breadcrumb }} + + {{ page.highlighted }} + + {{ page.help }} + + <main id="main" class="main" role="main" tabindex="-1"> + {{ page.preface }} + {{ page.content }} + {{ page.postscript }} + </main> + + {{ page.sitefooter }} + + {{ page.footer }} + + {% endblock %} diff --git a/templates/regions/region--sitefooter.html.twig b/templates/regions/region--sitefooter.html.twig new file mode 100644 index 00000000..b4ea61f3 --- /dev/null +++ b/templates/regions/region--sitefooter.html.twig @@ -0,0 +1,3 @@ +{% if content %} + {{ content }} +{% endif %} -- GitLab