From 5640d9b937ed0507fb8f5a5f5024d4c8c63ae966 Mon Sep 17 00:00:00 2001 From: rdrew Date: Mon, 8 Jun 2026 13:04:35 -0300 Subject: [PATCH] menu fix --- .php-cs-fixer.cache | 1 + .php-cs-fixer.dist.php | 28 ++++++++++++++++++++++++++++ css/components/islandora_mods.css | 3 +++ olivespostcards.theme | 17 +++++++++++++++++ 4 files changed, 49 insertions(+) create mode 100644 .php-cs-fixer.cache create mode 100644 .php-cs-fixer.dist.php diff --git a/.php-cs-fixer.cache b/.php-cs-fixer.cache new file mode 100644 index 0000000..bdd9300 --- /dev/null +++ b/.php-cs-fixer.cache @@ -0,0 +1 @@ +{"php":"8.5.6","version":"3.94.2","indent":" ","lineEnding":"\n","rules":{"nullable_type_declaration":true,"operator_linebreak":true,"ordered_types":{"null_adjustment":"always_last","sort_algorithm":"none"},"single_class_element_per_statement":true,"types_spaces":true,"array_indentation":true,"array_syntax":true,"attribute_block_no_spaces":true,"cast_spaces":true,"concat_space":{"spacing":"one"},"function_declaration":{"closure_fn_spacing":"none"},"method_argument_space":{"after_heredoc":false},"new_with_parentheses":{"anonymous_class":false},"single_line_empty_body":true,"single_space_around_construct":{"constructs_followed_by_a_single_space":["abstract","as","case","catch","class","const","const_import","do","else","elseif","enum","final","finally","for","foreach","function","function_import","if","insteadof","interface","match","named_argument","namespace","new","private","protected","public","readonly","static","switch","trait","try","type_colon","use","use_lambda","while"],"constructs_preceded_by_a_single_space":["as","else","elseif","use_lambda"]},"trailing_comma_in_multiline":{"after_heredoc":true,"elements":["arguments","array_destructuring","arrays","match","parameters"]},"binary_operator_spaces":{"default":"at_least_single_space"},"blank_line_after_opening_tag":true,"blank_line_between_import_groups":true,"blank_lines_before_namespace":true,"braces_position":{"allow_single_line_anonymous_functions":false,"allow_single_line_empty_anonymous_classes":true},"class_definition":{"inline_constructor_arguments":false,"space_before_parenthesis":true},"compact_nullable_type_declaration":true,"declare_equal_normalize":true,"lowercase_cast":true,"lowercase_static_reference":true,"modifier_keywords":true,"no_blank_lines_after_class_opening":true,"no_extra_blank_lines":{"tokens":["use"]},"no_leading_import_slash":true,"no_whitespace_in_blank_line":true,"ordered_class_elements":{"order":["use_trait"]},"ordered_imports":{"imports_order":["class","function","const"],"sort_algorithm":"none"},"return_type_declaration":true,"short_scalar_cast":true,"single_import_per_statement":{"group_to_single_imports":false},"single_trait_insert_per_statement":true,"ternary_operator_spaces":true,"unary_operator_spaces":{"only_dec_inc":true},"blank_line_after_namespace":true,"constant_case":true,"control_structure_braces":true,"control_structure_continuation_position":true,"elseif":true,"indentation_type":true,"line_ending":true,"lowercase_keywords":true,"no_break_comment":true,"no_closing_tag":true,"no_multiple_statements_per_line":true,"no_space_around_double_colon":true,"no_spaces_after_function_name":true,"no_trailing_whitespace":true,"no_trailing_whitespace_in_comment":true,"single_blank_line_at_eof":true,"single_line_after_imports":true,"spaces_inside_parentheses":true,"statement_indentation":true,"switch_case_semicolon_to_colon":true,"switch_case_space":true,"encoding":true,"full_opening_tag":true},"ruleCustomisationPolicyVersion":"null-policy","hashes":{".conform.5543326.olivespostcards.theme":"a53c01a22f6c8339ef654b8bdab85a53"}} \ No newline at end of file diff --git a/.php-cs-fixer.dist.php b/.php-cs-fixer.dist.php new file mode 100644 index 0000000..4324ce9 --- /dev/null +++ b/.php-cs-fixer.dist.php @@ -0,0 +1,28 @@ +setRiskyAllowed(false) + ->setRules([ + '@auto' => true + ]) + // 💡 by default, Fixer looks for `*.php` files excluding `./vendor/` - here, you can groom this config + ->setFinder( + (new Finder()) + // 💡 root folder to check + ->in(__DIR__) + // 💡 additional files, eg bin entry file + // ->append([__DIR__.'/bin-entry-file']) + // 💡 folders to exclude, if any + // ->exclude([/* ... */]) + // 💡 path patterns to exclude, if any + // ->notPath([/* ... */]) + // 💡 extra configs + // ->ignoreDotFiles(false) // true by default in v3, false in v4 or future mode + // ->ignoreVCS(true) // true by default + ) +; diff --git a/css/components/islandora_mods.css b/css/components/islandora_mods.css index 510dbc6..bd1c59b 100755 --- a/css/components/islandora_mods.css +++ b/css/components/islandora_mods.css @@ -257,3 +257,6 @@ nav.pager { text-decoration: none; color: var(--color-text-neutral-medium); } +span#override-default-display-mode { + display: none; +} diff --git a/olivespostcards.theme b/olivespostcards.theme index adcac5a..7ef5f94 100755 --- a/olivespostcards.theme +++ b/olivespostcards.theme @@ -44,6 +44,23 @@ function olivespostcards_preprocess_html(&$variables) { 'href' => $variables['olivespostcards_path'] . '/css/components/navigation/nav-primary-no-js.css?' . $query_string, ], ]; + // add body class based on path +// Get the current internal path (e.g., /node/123). + $current_path = \Drupal::service('path.current')->getPath(); + + // Get the path alias (returns the alias OR the internal path if no alias exists). + $path_output = \Drupal::service('path_alias.manager')->getAliasByPath($current_path); + + // Only add the class if the returned path is different from the internal path + // (meaning a custom alias exists) AND it's not empty. + if ($path_output && $path_output !== $current_path) { + $clean_alias = \Drupal\Component\Utility\Html::cleanCssIdentifier($path_output); + $variables['attributes']['class'][] = $clean_alias; + } + // Optional: Else, you could choose to add the system path class instead: + // else { + // $variables['attributes']['class'][] = \Drupal\Component\Utility\Html::cleanCssIdentifier($current_path); + // } }