facing problem while implementing plugin development #34556
Unanswered
ThisIsFaar
asked this question in
Q&A
Replies: 1 comment 2 replies
-
Never call Kind of this: <media folder="media" destination="plg_system_injectname">
<folder>js</folder>
</media> For joomla 4 look https://docs.joomla.org/J4.x:Web_Assets how to attach asset to document. /** @var Joomla\CMS\WebAsset\WebAssetManager $wa */
$wa = Factory::getApplication()->getDocument()->getWebAssetManager();
$wa->registerAndUseScript('plg_system_injectname', 'plg_system_injectname/main.js', []);
|
Beta Was this translation helpful? Give feedback.
2 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Uh oh!
There was an error while loading. Please reload this page.
-
I was learning plugin development from Joomla docs, I want to add my js file in the head by a plugin that I am working on
I am using onBeforeCompileHead event.
PROBLEM: not able to add my js file by this code, also implement a couple of ways nothing works for me.
Code is below
Beta Was this translation helpful? Give feedback.
All reactions