Jump to content

Module to change css


Recommended Posts

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

  • 3 weeks later...

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 account

Sign in

Already have an account? Sign in here.

Sign In Now
×
×
  • Create New...