Skip to content
Snippets Groups Projects
Commit 771e3e86 authored by Eric Bremner's avatar Eric Bremner
Browse files

ISTWCMS-5206: fixing view for certain image styles

parent 11b7124b
No related branches found
No related tags found
1 merge request!181ISTWCMS-5204: ensuring that image styles are created so that it can be used...
...@@ -733,13 +733,16 @@ function uw_cfg_common_preprocess_responsive_image(&$variables) { ...@@ -733,13 +733,16 @@ function uw_cfg_common_preprocess_responsive_image(&$variables) {
// Explode the current path so we can check where we are. // Explode the current path so we can check where we are.
$current_path_parts = explode('/', $current_path); $current_path_parts = explode('/', $current_path);
// If the current path has a node, we need to alter // Get the media library parameters, we will use this
// the image styles. // if we are on a media library page/modal.
if ($current_path_parts[1] == 'node') { $media_lib_parameters = \Drupal::request()->query->get('media_library_opener_parameters');
// Get the media library parameters, we will use this // If the current path has a node or media library params,
// if we are on a media library page/modal. // we need to alter the image styles.
$media_lib_parameters = \Drupal::request()->query->get('media_library_opener_parameters'); if (
$current_path_parts[1] == 'node' ||
$media_lib_parameters
) {
// If we are on a contact image, remove all styles // If we are on a contact image, remove all styles
// but those for portraits. // but those for portraits.
...@@ -754,7 +757,7 @@ function uw_cfg_common_preprocess_responsive_image(&$variables) { ...@@ -754,7 +757,7 @@ function uw_cfg_common_preprocess_responsive_image(&$variables) {
else { else {
// Get the styles used for responsive. // Get the styles used for responsive.
$uw_styles = \Drupal::service('uw_cfg_common.uw_service')->getCropImageStyles('portrait'); $uw_styles = \Drupal::service('uw_cfg_common.uw_service')->getCropImageStyles('responsive');
} }
// Step through each of the sources and see if we are. // Step through each of the sources and see if we are.
......
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