Module template override

  • Thomas
  • Thomas's Avatar Topic Author
  • Offline
  • New Member
  • New Member
More
10 years 4 months ago - 10 years 4 months ago #1 by Thomas
Module template override was created by Thomas
Hello,

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
Code:
include(JPATH_SITE.'/components/com_nspro/views/nspro/tmpl/default.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
Code:
$doc = JFactory::getDocument(); $app = JFactory::getApplication();
Code:
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 { include(JPATH_SITE.'/components/com_nspro/views/nspro/tmpl/default.php'); }
and it works like a charm. I think You should implement something like this. :)

Sincerely,
Thomas
Last edit: 10 years 4 months ago by Thomas.

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

Moderators: Christopher Mavros