User tests: Successful: Unsuccessful:
Pull Request for Issue #30272.
As discussed in the #30272 report, Joomla does not support namespaced templates, this commit solves that.
create()
method now checks for namespaced template
extension typesgetNamespaces()
method properly recognize Administrator and Site templates; in addition, it will look for templateDetails.xml
file instead of extensionName.xml
and read the designated namespace (Line 182)Other change
defined('_JEXEC') or die;
with defined('JPATH_PLATFORM') or die;
, perhaps this change was also expected? Either way, it was my best guess.In order to enable namespace for templates, here are the few steps, we'll use the default site template:
site/templates/cassiopeia/templateDetails.xml
and add between <description>
and <files>
the following<namespace path="src">Joomla\Template\Cassiopeia</namespace>
site/administrator/cache/autoload_psr4.php
site/administrator
site/administrator/cache/autoload_psr4.php
, the last element of the return object should be'Joomla\\Template\\Cassiopeia\\Site\\' => [JPATH_SITE . '/templates/cassiopeia/src']
site/templates/cassiopeia/src/Field
folder and add it to the templateDetails.xml
along with addfieldprefix="Joomla\Template\Cassiopeia\Site\Field"
attribute added to the parent <fieldset>
The namespacemap.php
class had no support for Site Templates / Administrator Templates. addfieldpreffix
couldn't be used with template defined custom fields.
Site Templates / Administrator Templates can be developed with namespace features.
Yes. (I wish I knew where)
4.1-dev
branch as well?staging
branch? If yes, where is the namespacemap.php
file?Status | New | ⇒ | Pending |
Category | ⇒ | Libraries |
Status | Pending | ⇒ | Closed |
Closed_Date | 0000-00-00 00:00:00 | ⇒ | 2020-09-30 12:37:20 |
Closed_By | ⇒ | thednp | |
Labels |
Added:
?
|