I'm using an old version of this theme so you may have fixed this already but I was noticing the body tag does not have the current url of the page which makes customizing the theming a little harder. I noticed you can fix this by adding this to the .theme file:
Under this line...
function openy_carnation_preprocess_html(array &$variables) {
Add
// Get the current path
$current_path = \Drupal::service('path.current')->getPath();
$internal_path = \Drupal::service('path_alias.manager')->getAliasByPath($current_path);
// Assign it to body class
$variables['attributes']['class'][] = str_replace("/", "", $internal_path);Apologies if you've already fixed this or if this isn't the best way to do this, it worked great for me. Thanks for your hard work!
Issue fork openy_carnation-3305569
Show commands
Start within a Git clone of the project using the version control instructions.
Or, if you do not have SSH keys set up on git.drupalcode.org:
Comments
Comment #2
podarokHi @plato1123
Could you create a Merge request with this change?
Thank you in advance
Comment #5
anchal_gupta commentedCommitted and MR as per the suggestion provided.
Comment #6
podarokmerged in 1.0.x
Comment #7
podarokNeeds upport to 2.0.x branch
Comment #10
podarokThis is done
Comment #12
drupalnesia commentedAlternate module: https://www.drupal.org/project/path_alias_class
This module add classes automatically from website Path and Path Alias. Also you can add Custom CSS.
For example, if you have a node with title "Training" and NID is 77 then this module will automatically add these classes: training node-77.
This additional classes will help you easier to modify site appearance using CSS. Now you can styling the "training or node-77" page.