Module template override
- Thomas
-
Topic Author
- Offline
- New Member
-
Less
More
- Posts: 1
- Thank you received: 0
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.
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
and it works like a charm. I think You should implement something like this. 
Sincerely,
Thomas
I bought today Yours NS Pro - hope it will serve me well.
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');
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');
}
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