VirtueMart Forum

VirtueMart 2 + 3 + 4 => Templating & Layouts => Topic started by: EvanGR on December 09, 2019, 15:36:56 PM

Title: [SOLVED] Dynamic module position within product layout?
Post by: EvanGR on December 09, 2019, 15:36:56 PM
I am trying to add new module positions, inside the product layout.

I inserted the following in the product template override file (php):
<jdoc:include type="modules" name="product-modules-bottom"   />

I then assigned a custom module to that position. But it doesn't seem to work?
Something I missed?

Thanks
Title: Re: Dynamic module position within product layout?
Post by: GJC Web Design on December 09, 2019, 15:39:24 PM
QuoteSomething I missed?
yep .. that is only joomla template code

try

$modules = JModuleHelper::getModules('your_position');
foreach ($modules as $module)
{
echo JModuleHelper::renderModule($module);
}
Title: Re: Dynamic module position within product layout?
Post by: Spiros Petrakis on December 10, 2019, 14:18:45 PM
You can also try this :

echo JHtml::_('content.prepare', '{loadposition YOUR_POSITION}');
Title: Re: Dynamic module position within product layout?
Post by: EvanGR on December 11, 2019, 09:35:15 AM
Thank you people!