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.

  • Any reason why you would like to have abstolute path instead of relative one? – webchun May 15 at 6:49
  • As you can see I used dirname() to get the absolute path, but I only want to avoid using templateName so I can reuse that field in other extensions. – thednp May 15 at 7:13

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.