Hello,
You could use
Then declare the style accordingly.
That said, if it's just for a custom style, you don't need an extension.
Twig's date() filter does the job.
You could use
BODY_CLASS
.Code:
$this->template->assign_vars(['BODY_CLASS'=> $spwclass,]);
Code:
.styleedits0 .headerbar {}.styleedits2 .headerbar {}.styleedits4 .headerbar {}...
Twig's date() filter does the job.
Code:
{% set classesname = [ 'styleedits0', 'styleedits2', 'styleedits4', 'styleedits6', 'styleedits8', 'styleedits10', 'styleedits12', 'styleedits14', 'styleedits16', 'styleedits18', 'styleedits20', 'styleedits22'] %}{% set currenthour = "now"|date("H")|int %}{% set index = (currenthour // 2) %} {% set spwclass = classesname[index] %}<div class="headerbar {{ spwclass }}" role="banner">
Statistics: Posted by cabot — Thu Jan 30, 2025 2:15 pm