Unwanted behavior with getWebAssetManager

This forum is for general questions about extensions for Joomla! 4.x.

Moderators: pe7er, General Support Moderators

Forum rules
Forum Rules
Absolute Beginner's Guide to Joomla! <-- please read before posting, this means YOU.
Forum Post Assistant - If you are serious about wanting help, you will use this tool to help you post.
Windows Defender SmartScreen Issues <-- please read this if using Windows 10.
Post Reply
Nitemare
Joomla! Fledgling
Joomla! Fledgling
Posts: 4
Joined: Tue Aug 23, 2011 11:59 am

Unwanted behavior with getWebAssetManager

Post by Nitemare » Wed Sep 15, 2021 4:17 pm

Hello, this is my first approach to Web Asset Manager.
I have a long experience creating templates, extensions, modules and plugins for Joomla 3.x (and 2.x) but now I'm migrating my template and all my extensions to new extension organization proposed for Joomla 4.x. My template is fully migrated, using "getWebAssetManager" to load some script and style files (I have defined the rules in joomla.asset.json file and then grouped in a "preset" entry, which is loaded in my template, as Cassiopeia template does. That's right and that works). The problem is in my extensions. I have created a simple almost-empty extension to test script and style loading via Web Asset Manager but my BIG problem is that my extension script(s) and style(s) file(s) are loaded BEFORE template scripts and styles.
With 3.x extensions, scripts and styles were loaded AFTER template scripts and styles (so, my extension could "extend" or override template styles, if needed) but I can't reproduce that (desired) behavior using Web Asset Manager and joomla.asset.json files.
I just need that my extensions scripts and styles load after all scripts and styles from the template, is it possible? how?
------------------------------------------
Nitemare

Post Reply

Return to “Extensions for Joomla! 4.x”