THELIA Forum

Welcome to the THELIA support and discusssion forum

Offline

#1 Loading Module Assets

(28-09-2016 18:30:00)


Hi,

I have created a module which had the following hook configuration

<hook id="homevideo.hook" class="HomeVideo\Hook\MySuperHook">
            <tag name="hook.event_listener" event="main.head-bottom" templates="css:assets/css/styles.css" />
            <tag name="hook.event_listener" event="main.head-bottom" templates="css:assets/css/youmax-lite.min.css" />
            <tag name="hook.event_listener" event="main.after-javascript-include" templates="js:assets/js/youmax-lite.min.js" />
            <tag name="hook.event_listener" event="main.content-stretch" templates="main-stretch.html"/>
</hook>

I wanted to include multilpe assets ont he same event but realised I was doing it wrong and changed code to the following:

<hook id="homevideo.hook">
            <tag name="hook.event_listener" event="main.head-bottom" type="front" templates="css:assets/css/youmax-lite.min.css;css:assets/css/styles.css" />
            <tag name="hook.event_listener" event="main.after-javascript-include" type="front" templates="js:assets/js/youmax-lite.min.js;js:assets/js/youtube.js" />
            <tag name="hook.event_listener" event="main.content-stretch" templates="main-stretch.html"/>
</hook>

My problem is that only minified versions of styles.css and youmax-lite.min.js is generated even when I rmove them from the hook definition. I have tried to clear cache but same thing still happens.

What do I need to do?

Offline

#2 Re: Loading Module Assets

(28-09-2016 19:12:44)


My problem is that only minified versions of styles.css and youmax-lite.min.js is generated even when I rmove them from the hook definition

I don't understand why this is a problem.

Here's the documentation of this feature: http://doc.thelia.net/en/documentation/ … -thelia-23


CQFDev | Sites, boutiques, modules, développement et intégration pour Thelia 1 et 2

Offline

#3 Re: Loading Module Assets

(28-09-2016 19:44:16)


The problem is that not all javascripts / css are loaded therefore website not appearing as intended. Have you looked at my hook definition? Is it correct? That would be a place to start because I am including 2 css files and 2 javascript files but only one of each is loaded

Offline

#4 Re: Loading Module Assets

(28-09-2016 19:56:03)


Don't worry. I figured it out. thanks