Skip to content
Snippets Groups Projects
Commit 6f41aef0 authored by Kevin Paxman's avatar Kevin Paxman
Browse files

Merge branch 'feature/ISTWCMS-5880-ebremner-banners-above' into '1.1.x'

ISTWCMS-5880: adding logic for headers/title in contacts

See merge request !85
parents 44674e35 edf59ef2
No related branches found
No related tags found
1 merge request!85ISTWCMS-5880: adding logic for headers/title in contacts
{% if media == 'no' %}
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
{% if show_title is not defined %}
{% set show_title = TRUE %}
{% endif %}
{%
set classes = [
'block',
'block-' ~ configuration.provider|clean_class,
'block-' ~ plugin_id|clean_class,
]
%}
{#This is to show the title to the user at top of page inside the collapsable area, when doing the updates in layout builder#}
{% if not show_title and in_layout_builder %}
<div{{ attributes.addClass(classes) }}>
{% block page_title_content %}
{{ content }}
{% endblock %}
</div>
{% endif %}
{% if show_title %}
<div{{ attributes.addClass(classes) }}>
{% if admin_label %}
<div class="uw-admin-label">{{ admin_label }}</div>
......@@ -21,40 +32,3 @@
{% endblock %}
</div>
{% endif %}
{# // OHANA // OHANA // OHANA // OHANA
/**
* @file
* Theme override for page title block.
*/
{% set classes = [
'l-block--provider-' ~ configuration.provider|clean_class,
'l-block--id-' ~ plugin_id|clean_class,
] %}
{% set attributes = attributes.addClass(classes) %}
{% embed '@layouts/block/block.twig' with {
'attributes': attributes,
'block_wrapper': true,
'constrain': '',
'title_prefix': title_prefix,
'title_suffix': title_suffix,
'label': label is not empty ? label : false,
'content_wrapper': true
} %}
{% block content %}
{% include '@components/page-title/page-title.twig' with {
'page_title': content['#title']
} %}
{% endblock %}
{% endembed %}
OHANA // OHANA // OHANA // OHANA #}
......@@ -100,7 +100,8 @@
<div{{ content_attributes.addClass('node__content') }}>
{% include '@components/card/card--node/_card--node.twig' with {
'node': node_data,
'type': 'node'
'type': 'node',
'media_flags': media_flags
} %}
</div>
{% endblock %}
......
......@@ -506,6 +506,17 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) {
// Load the node.
$node = \Drupal::routeMatch()->getParameter('node');
// If this is a node, check for contact and set if we
// have to hide the title.
if ($node = \Drupal::routeMatch()->getParameter('node')) {
// Get the media flags.
$media_flags = \Drupal::service('uw_cfg_common.uw_service')->uwGetMediaFlags($node);
// Set the show title flag.
$variables['show_title'] = $media_flags['has_media'] || $media_flags['has_portrait'] ? FALSE : TRUE;
}
// ISTWCMS-4943: ensure that we get a node object.
// If node is not object by this point, probably on
// a revision page where node is an integer, so load
......@@ -614,11 +625,12 @@ function uw_fdsu_theme_resp_preprocess_container(&$variables) {
// Set variables for featured image.
$variables['node_type'] = str_replace('_', '-', $node->getType());
$variables['media'] = $uwService->uwCheckNodeForMedia($node);
$variables['media_flags'] = $uwService->uwGetMediaFlags($node);
// If there is a node object, get the header and footer data.
if ($node) {
$variables['header_data'] = $uwNodeContent->getNodeContent($node, 'teaser', 'header');
$variables['footer_data'] = $uwNodeContent->getNodeContent($node, 'teaser', 'footer');
$variables['header_data'] = $uwNodeContent->getNodeContent($node, 'full', 'header');
$variables['footer_data'] = $uwNodeContent->getNodeContent($node, 'full', 'footer');
}
}
}
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment