Feature request: username in <body> class

Hello:

Requesting that when a page is being edited has a class: user_, indicating the user who is editing the page, as is the case when editing dynamic content. I know I can get that from the livewhale[‘username’], but I am thinking of simple cases where I just want to be able to have a basic css selector: body.user_gcervone and not involve any js.

Thanks,

-= G =-

sorry - just realised there is now a feature requests forum - can you move this?

Thanks,

-= G =-

I have the following for a similar need. Could make something similar, if you’re able to get the current editors username from $_LW or another method.

PHP Module

<?php
$_LW->REGISTERED_APPS['add_body_class']=[
  'title'=>'Add Body Class',
  'handlers'=>array('onLoad'),
];

class LiveWhaleApplicationAddBodyClass {
  public function onLoad() {
    global $_LW;
    /* Today's Date Classes */
    // append weekday
    $_LW->appendBodyClass('w_'.strtolower(date('D'))); //sun, mon, tue, etc.
    // append month
    $_LW->appendBodyClass('m_'.strtolower(date('M'))); //jan, feb, mar, etc.
    // append date
    $_LW->appendBodyClass('d_'.date('d')); // 01, 02, ... 09, 10, 11, ... 30, 31
    // append year
    $_LW->appendBodyClass('y_'.date('Y')); // 2020, 2021, etc.
  }
}
?>

Related SCSS, for context

// Navigation Deposit Link (dfbb3f7e)
body.m_sep,
body.m_oct,
body.m_nov {
  .site-header-top, 
  .site-header-nav-wrapper {
    .lw_item_8e5a548e { display: none; } // hide and simplify navigation
  }
}
body.group_admissions,
body.video-tour-page {
  &.m_feb,
  &.m_mar,
  &.m_apr,
  &.m_may {
    .site-header-top, 
    .site-header-nav-wrapper {
      .lw_item_8e5a548e a {color: #FFDC8A;} // highlight during yield season
    }
  }
}

yes - that’s good thanks - your solution is good. I figured I would need to do something like that but put it in as a feature request because it feels like it should be part of the product to be consistent with the way dynamic content is handled, and could then be useful for people who don’t have a coding team.

Thanks again,

-= G =-