Adding field path and script into form relative to template path

by thednp   Last Updated May 15, 2019 05:10 AM

Case 1

I am trying to add field path into templateDetails.xml without specifying a templateName. The following code works

<fieldset name="name" label="label" addfieldpath="/templates/templateName/fields">

But I wonder if it's possible to do something like this

<fieldset name="name" label="label" addfieldpath="__DIR__/fields">

Case 2

Also, the field in question is loading it's own JavaScript file via

JHtml::_('script', '/templates/templateName/js/field.js' );

works fine, but giving it absolute path doesn't work

JHtml::_('script', dirname(dirname(__FILE__)).'/js/fieldName.js' );

I know JHtml::script is deprecated in Joomla 4, but is still not working for me for some reason.

Thanks for any hint/suggestion.

Related Questions

Custom JS Module and Image Src Broken

Updated July 11, 2019 11:10 AM