How to get the path to the current template in Joomla 1.5?

nickf picture nickf · Dec 19, 2008 · Viewed 33.6k times · Source

I'm writing a component and would like to insert images from the template folder.

How do you get the correct path to the template folder?

Answer

jlleblanc picture jlleblanc · Dec 19, 2008

IIRC, the $mainframe global object is eventually going away. Here is a way to do it through the framework:

$app = JFactory::getApplication();
$templateDir = JURI::base() . 'templates/' . $app->getTemplate();