Module template override

6 years 7 months ago - 6 years 7 months ago #1 by Thomas
Module template override was created by Thomas

I bought today Yours NS Pro - hope it will serve me well. :D Now, I was trying to override the module template and saw something like this in the mod_nspro.php
but if You write it like this then the module won't look for the template override. I don't know (yet) what's the proper way of searching for overrides in Joomla, but I wrote it like this
somewhere eariler
$doc = JFactory::getDocument();
    $app = JFactory::getApplication();
if( file_exists(JPATH_SITE.'/templates/' . $app->getTemplate() . '/html/nspro/default.php') && is_readable(JPATH_SITE.'/templates/' . $app->getTemplate() . '/html/nspro/default.php') && include(JPATH_SITE.'/templates/' . $app->getTemplate() . '/html/nspro/default.php')){
    else {
and it works like a charm. I think You should implement something like this. :)


Please Log in or Create an account to join the conversation.

Moderators: Christopher Mavros