0

I'm working on namespaced templates feature and I came to the point where I need to check if an extension is namespaced or not.

One possibility would be to load the templateDetails.xml file and check manually. I only wonder if there is anything in the Joomla namespace libraries that saves the day.

I also appreciate any suggestion/reply.

Thank you

0

The only thing I could think of is just to check the XML file:

$templatesPath = ((int) $this->template->client_id === 1 ? JPATH_ADMINISTRATOR : JPATH_SITE) . '/templates/';
$templateDetails = $templatesPath . $this->template->name . '/templateDetails.xml';
$templateXML = simplexml_load_file($templateDetails);

if ($templateXML->namespace === null || (string) $templateXML->namespace === '') {
  // do something with non-namespaced template
}

Till other solution comes up, this is the only thing I got it working.

2

Your Answer

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

Not the answer you're looking for? Browse other questions tagged or ask your own question.