PHP script is duplicating Joomla! module content -
PHP script is duplicating Joomla! module content -
i have found little script have used within joomla template check , see if there module assigned particular module position on current page.
<?php $attribs['style'] = 'xhtml'; $modules_html = ''; foreach (jmodulehelper::getmodules( 'module_position' ) $module) $modules_html .= jmodulehelper::rendermodule( $module, $attribs ); $show_module=trim($modules_html) != ''; if ($show_module) { ?> <jdoc:include type="modules" name="module_position" style="xhtml" /> <?php } ?>
the script works duplicates module wrapper div , title output follows:
<div class="moduletable"> <h3>module title</h3> <div class="moduletable"> <h3>module title</h3> <p>content here</p> </div> </div>
i rid of duplicate wrapper , title cannot figure out life of me how so.
suggestions welcome.
cheers!
you putting jdoc tag in loop repeated if have multiple modules published on same position.
you need have once. can utilize countmodules function of joomla. see here http://docs.joomla.org/jdocumenthtml/countmodules
php joomla module duplicates
Comments
Post a Comment