Would be great to have a class indicating the logged-in user when editing pages as is the case with dynamic content. Ex: user_gcervone class on when editing a page.
Thanks,
-= G =-
Would be great to have a class indicating the logged-in user when editing pages as is the case with dynamic content. Ex: user_gcervone class on when editing a page.
Thanks,
-= G =-
for that matter it would also be very useful to have an equivalent to /_ingredients/backend/backend.js that would work for page edits.
The username is currently available in Javascript, if applicable.
Else, I have a custom module to do similar things. For instance:
<?php
public function onLoad() { // runs when this application module is loaded
global $_LW;
/* Today's Date Classes */
// Cache check (minor but all pages)
$key = 'todays_date_classes';
$date_classes = $_LW->getVariable($key);
if (empty($date_classes)) {
$date_classes = [
'w' => 'w_'.strtolower(date('D')), // day of week (sun, mon, ... sat)
'm' => 'm_'.strtolower(date('M')), // month (jan, feb, ... dec)
'd' => 'd_'.date('d'), // day (01, 02, ... 31)
'y' => 'y_'.date('Y'), // year (2020, 2021...)
];
$_LW->setVariable($key, $date_classes, 120); // 120 seconds
}
// Append defined classes
foreach ($date_classes as $class) {
$_LW->appendBodyClass($class);
}
}
The result:
