Hello!
This is the first time i'm trying to use Sourcerer inside a custom module with JCE as editor and Javascript coding, i already use Sourcerer without editors inside some template areas for PHP coding, but now i can't make it work.
I trying to create a simple alert using custom module with JCE by this code:
{source}<?php
$document->getAssetManager()->addInlineScript(
'alert(\'This is JavaScript\');',
['position' => 'before']
);
?>{/source}
But the module visualize my full code and return also: 0 Call to undefined method Joomla\CMS\Document\HtmlDocument::getAssetManager()
I'm using J4.1 and Sourcerer 9.2.1PRO, where i'm wrong?
No Peter, seems Sourcerer not yet working perfect: when i insert a JS code Sourcerer DEV still create $document->getAssetManager()->addInlineScript....