gim295 Posted February 17, 2022 Share Posted February 17, 2022 Hello i'm trying to do a module to change an image on css. I can change the image using FrontController.php and header tpl like this. FrontController.php private function eventDateChecker(){ $date_time_end = '2021-01-01'; $date_time_now = date("Y-m-d"); $date_time_end = strtotime($date_time_end); $date_time_now = strtotime($date_time_now); if ($date_time_end >= $date_time_now){ $image_event_active = 1; }else{ $image_event_active = 0; } $this->context->smarty->assign('image_event_active', $image_event_active); } header.tpl {if $image_event_active == 1} {literal} <style> #header .sf-menu:before { width: 238px; height: 116px; background-image: url(/themes/dema/img/header-bg.png); top: inherit; bottom: 70px; left: 15%; } } </style> {/literal} {/if} How can i create a module to let the admins change the image and the dates on cms? Link to comment Share on other sites More sharing options...
Ress Posted March 6, 2022 Share Posted March 6, 2022 You can create a module, with a simple form, where you can change that dates, and you can use the displayHeader hook to load that dynamic css. Link to comment Share on other sites More sharing options...
Recommended Posts
Create an account or sign in to comment
You need to be a member in order to leave a comment
Create an account
Sign up for a new account in our community. It's easy!
Register a new accountSign in
Already have an account? Sign in here.
Sign In Now