Jump to content

Module custom css not loading Front office Prestashop 1.7.7.2


Recommended Posts

Hey, 

I am a couple of days trying to solve it without sucess.

I am trying to add custom css to my front module template, but the page is not loading the files. I have no idea where I am screwing it up.

In my Module controller I have:

 

class <ControllerNameFollowingThePattern> extends ModuleFrontController
{
    public function __construct()
    {
        parent::__construct();   
        
    }

    public $auth = false;
    public $ssl = true;
        
    public function init()
    {
        parent::init();
    }

    public function initContent()
    {
       // stuff here
    }

    public function setMedia()
    {
      parent::setMedia();

      $this->registerStylesheet(
        'module-mymodule-style',
        'modules/'.$this->module->name.'/css/mycustom.css',
        [
            'media' => 'all',
            'priority' => 0,
        ]
      );
    }

}

 

The directories for the module and css are
 

-Modules
-- mymodule
---- css
-----  mycustom.css

 

I would highly appreciate if someone could help me.

Thanks a lot!

 

 

Link to comment
Share on other sites

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...