Skip to content
Snippets Groups Projects
Commit 9fee5b0b authored by Eric Bremner's avatar Eric Bremner Committed by Kevin Paxman
Browse files

ISTWCMS-5880: using media flags instead of logic in PL

parent d596a31e
No related branches found
No related tags found
1 merge request!85ISTWCMS-5880: adding logic for headers/title in contacts
{% set show_title = TRUE %} {% if show_title %}
{% if hide_page_title %}
{% set show_title = FALSE %}
{% elseif media == 'yes' %}
{% set show_title = FALSE %}
{% endif %}
{% if show_title %}
{% {%
set classes = [ set classes = [
'block', 'block',
......
...@@ -100,7 +100,8 @@ ...@@ -100,7 +100,8 @@
<div{{ content_attributes.addClass('node__content') }}> <div{{ content_attributes.addClass('node__content') }}>
{% include '@components/card/card--node/_card--node.twig' with { {% include '@components/card/card--node/_card--node.twig' with {
'node': node_data, 'node': node_data,
'type': 'node' 'type': 'node',
'media_flags': media_flags
} %} } %}
</div> </div>
{% endblock %} {% endblock %}
......
...@@ -506,10 +506,15 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) { ...@@ -506,10 +506,15 @@ function uw_fdsu_theme_resp_preprocess_block(&$variables) {
// Load the node. // Load the node.
$node = \Drupal::routeMatch()->getParameter('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')) { if ($node = \Drupal::routeMatch()->getParameter('node')) {
if ($node->getType() == 'uw_ct_contact') {
$variables['hide_page_title'] = TRUE; // Get the media falgs
} $media_flags = \Drupal::service('uw_cfg_common.uw_service')->uwGetMediaFlags($node);
// Set the show title flag.
$variables['show_title'] = $media_flags['has_media'] ? FALSE : TRUE;
} }
// ISTWCMS-4943: ensure that we get a node object. // ISTWCMS-4943: ensure that we get a node object.
......
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