I have a quick question connected with my little knowledge of Joomla\K2. I'm using subtemplates to create different layouts for different pages. When I declare module position on sub template:
<jdoc:include type="modules" name="position-7" />
Nothing happens. I've tried the same code for main template file and it worked, but seems like it's not parsed for sub-templates. Am I right? How can I include modules into sub-templates then?
thanks in advance, Michael
jdoc tag only works in joomla core template. If you want to load modules of specific position in your k2 subtemplate write the following code at your desired location in that subtemplate.
$module = JModuleHelper::getModules('xxxx');
// xxxx is any virtual position, no need to create it anywhere.
echo JModuleHelper::renderModule($module[0]);
replace xxxx with your desired position name.