dependencies priority Developer

How to use the assets of my bundle instead of the asset from another one?

Question

I am trying to add a reference to font awesome in my project.

Font Awesome assets are presents in my bundle, and added a reference to it like using

<template:addResources type="css" resources="fontawesome.min.css" />

However, when the page is rendered, a different version of Font Awesome is being included in my page. I assume it is going off some filter or something. How can I make it use my version?

Answer

The only way to tell Jahia to use the assets provided in your template set (instead of the assets provided by the font-awesome bundle) is to increase the priority of your bundle. This is what we call the Jahia-Module-Priority.

In the Font Awesome bundle, we use a priority of 2 (which is bigger than the default value (1), as you can see in the project pom.xml

So if you want to us another fontawesome.min.css (provided by your bundles) then you need to increase the Jahia-Module-Priority to >= 3 for that bundle.

<properties>
    <Jahia-Module-Priority>3</Jahia-Module-Priority>
</properties>