Commit f2ab5cbf authored by Chris Shantz's avatar Chris Shantz
Browse files

Merge branch '1.0.x' into prod/1.0.x

parents e0fd8b07 7a822f68
......@@ -3,28 +3,50 @@ status: true
dependencies:
module:
- node
id: default
label: Default
id: default
description: 'A default Linkit profile'
matchers:
556010a3-e317-48b3-b4ed-854c10f4b950:
uuid: 556010a3-e317-48b3-b4ed-854c10f4b950
id: 'entity:node'
weight: 0
uuid: 556010a3-e317-48b3-b4ed-854c10f4b950
settings:
metadata: '[node:content-type] by [node:author] | [node:created:long] (node [node:nid])'
bundles: { }
group_by_bundle: false
include_unpublished: true
substitution_type: canonical
limit: 100
include_unpublished: true
weight: -9
6104a100-f463-4c40-8bde-6c442591afe7:
uuid: 6104a100-f463-4c40-8bde-6c442591afe7
id: email
weight: 0
uuid: 6104a100-f463-4c40-8bde-6c442591afe7
settings: { }
weight: -6
d53fbc60-f2a7-40b5-a643-1c20c21143a4:
uuid: d53fbc60-f2a7-40b5-a643-1c20c21143a4
id: anchor_basic
weight: 0
uuid: d53fbc60-f2a7-40b5-a643-1c20c21143a4
settings: { }
weight: -10
dbcc29e8-5c1a-4a8f-8a76-f4f7adc645a5:
id: 'entity:media'
uuid: dbcc29e8-5c1a-4a8f-8a76-f4f7adc645a5
settings:
metadata: '<img src="[media:field_media_image:linkit_result_thumbnail]" alt="[media:field_media_image:alt]">'
bundles:
uw_mt_image: uw_mt_image
group_by_bundle: true
substitution_type: media
limit: 100
weight: -8
280dc52b-0208-4458-b3dc-21ddbaac15e8:
id: 'entity:media'
uuid: 280dc52b-0208-4458-b3dc-21ddbaac15e8
settings:
metadata: ''
bundles:
uw_mt_file: uw_mt_file
group_by_bundle: true
substitution_type: media
limit: 100
weight: -7
......@@ -70,7 +70,7 @@ class UwNodeAccessCheck implements AccessInterface {
return AccessResult::forbidden();
}
// Check if this is a sidebar content type and if the user has permission
// Check if this is a footer content type and if the user has permission
// to edit the content type. Return access denied when user has no edit
// permission.
if ($node && $node->bundle() == 'uw_ct_site_footer' && !$account->hasPermission('edit any uw_ct_site_footer content')) {
......
......@@ -487,20 +487,42 @@ class UwNodeContent {
// on the view mode.
if ($node_flags['get_image']) {
// If we are on a layout page, use the portrait image.
if (\Drupal::routeMatch()->getRouteName() == 'layout_builder.overrides.node.view') {
$use_portrait = TRUE;
}
// If it is a teaser use the listing image, if not use the portrait image.
if ($view_mode == 'teaser') {
$content_data['image'] = $this->addToContentData('image', 'field_uw_contact_listing_image');
elseif ($view_mode == 'teaser') {
$use_portrait = FALSE;
}
else {
$use_portrait = TRUE;
}
// If we are to use the portrait image, set the variables and
// extra options. If not, use the listing image.
if ($use_portrait) {
// Set the portrait image.
$content_data['image'] = $this->addToContentData('image', 'field_uw_ct_contact_image');
// Add the extra options for portrait image style.
$content_data['image']['extra_options'] = [
'type' => 'portrait',
'crop' => 'portrait',
'is_responsive' => TRUE,
];
}
else {
// Add the extra options for portrait image style.
$content_data['image']['extra_options'] = [
'type' => 'portrait',
'crop' => 'portrait',
'is_responsive' => TRUE,
];
// Use the listing image.
$content_data['image'] = $this->addToContentData('image', 'field_uw_contact_listing_image');
$content_data['image']['extra_options'] = [
'type' => 'listing_image',
'is_responsive' => TRUE,
];
}
}
// Setup the actual content.
......
......@@ -694,6 +694,9 @@ class UwNodeFieldValue {
// Get the date query parameter.
$date_parameter = $this->requestStack->getCurrentRequest()->query->get('date');
// Get the date type query parameter.
$date_type = $this->requestStack->getCurrentRequest()->query->get('date_type');
// If there is a date query parameter, convert
// to timestamp so we can compare against dates
// in the event. If there is no parameter, set
......@@ -711,9 +714,9 @@ class UwNodeFieldValue {
// ISTWCMS-5088: we need to ensure that at least
// some dates show on the node page, so let's just
// display them all.
// display them all or if operator is >=.
// If not node page, only get dates in the future.
if ($view_mode == 'full') {
if ($view_mode == 'full' || ($date_type !== '>=')) {
$return_dates[] = $this->getDate($date, 'event');
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment