Initially I've posted a question on joomla.stackexchange.com, but I think it would be better to report the issue right here.
It seems addfieldprefix isn't working with Joomla 4 SITE templates, also there is no documentation, resource or any information on using namespaces with Joomla 4 templates.
So far, namespaced plugins seem to work fine when re-using custom form fields from plugin to plugin, but a template cannot do that with it's own custom fields or namespaced plugin form fields.
Even if we were to implement something like a library, we would still not be able to use them with templates.
Probably editing Joomla/libraries/namespacemap.php to include template and enable the ability to add <namespace>Joomla\CMS\Template\TemplateName</namespace> in the templateDetails.xml file.
addfieldpath with addfieldprefix to work with templates? We can use the namespace to extend a template namespace with something useful like a TemplateHelper for various capabilities.addfieldpath and addfieldprefix attributes both going to be supported in Joomla 4+?| Labels |
Added:
?
|
||
Copy from my templateDetails.xml
addfieldprefix="Joomla\CMS\Plugin\EditorsXtd\Vimeo\Field"
I misspelled here only, will correct the above.
Yes there's no real concept of namespaced resources for templates. However you can still use addFieldPath and addFieldPrefix from J3. Although I'm not against introducing the concept of a namespaced autoloaded area for templates either.
Yes there's no real concept of namespaced resources for templates. However you can still use addFieldPath and addFieldPrefix from J3. Although I'm not against introducing the concept of a namespaced autoloaded area for templates either.
My concerns:
addfieldpath is going to be deprecated, gonna be a nightmare to update 10+ templatesaddfieldpath is not working with form fields defined in namespaced plugins/pluginTYPE/pluginName/Field plugin folder (I tested as writing here), I would have to do something like plugins/pluginTYPE/pluginName/fieldsLegacy for addfieldpath, but why would we have to do that?so if you're using formfields in the plugins directory then you need to use the addfieldprefix and that should work just fine in j4. i assumed you were talking about form fields within the template itself (which of course wouldn't be autoloaded). Using a combination of addfieldpath and addfieldprefix should be fine too.
so if you're using formfields in the plugins directory then you need to use the
addfieldprefixand that should work just fine in j4.
No, I said I wanna use form fileds from my plugins directory in the template form via addfieldprefix.
i assumed you were talking about form fields within the template itself (which of course wouldn't be autoloaded). Using a combination of
addfieldpathandaddfieldprefixshould be fine too.
Also this should work with addfieldprefix currently loading only via addfieldpath and the old "namespace".
So, we need to make custom form fields to autoload via addfieldprefix in template forms.
No, I said I wanna use form fileds from my plugins directory in the template form via addfieldprefix.
That should work fine - we'll need to spend some time figuring out what doesn't work exactly here. The plugins if you've defined the namespace section should be autoloaded just fine.
I'm talking with my files in front of me, it doesn't work and you're talking "should".
@wilsonge after a while I realize I was replying here with a little bit of pressure, my apologies.
I had a type error addfieldprefix="Joomla\CMS\Plugin\EditorsXtd\Vimeo\Field" should have been addfieldprefix="Joomla\Plugin\EditorsXtd\Vimeo\Field", this works in templateDetails.xml (facepalm).
I have good news, I've implemented namespace templates with #30816, please test and report back any suggestion or idea.
Thanks and good day.
| Status | New | ⇒ | Closed |
| Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-11-25 13:11:08 |
| Closed_By | ⇒ | HLeithner |
Not an answer. I don't know. But
Is it just a typo inside this issue?
addfieldpreffix(2 f)versus
addfieldprefix