
This modification will alow modules to be placed in a new position "content" when a page gets loaded with a module in the "content" position this module replaces any Joomla content that would have been published. This is useful if you want to remove any content from say the homepage, a landing page or even a single page and replace it with a module to provide the content. Specifically used for landing pages where you can have a set of promo module items replacing the normal Joomla blog content.
This modification requires you going in and hacking the final template design and will get broken if you then go and edit that template through Themler.
Inside the generated template do the following:
[1] Find the /templates directory inside the Themler generated template zip file. You will need to change all /templates files you use in your templates
find the code that outputs the joomla content:
<div class="bd-container-inner">
<?php $document="JFactory::getDocument();" echo="" $document-=""?>view->renderSystemMessages();
$document->view->componentWrapper('common');
echo '<jdoc:include type="component"></jdoc:include>';
?>
</div>
replace with this new code which checks for the presence of a module "content" and if it finds one displays it instead of the joomla content.
<div class="bd-container-inner">
<?php $document="JFactory::getDocument();" echo="" $document-=""?>view->renderSystemMessages();
$document = JFactory::getDocument();
$view = $document->view;
if ($view->containsModules('content') == 1) {
echo buildDataPositionAttr('content');
echo $view->position('content', 'block%joomlaposition_content', '0'); }
else { $document->view->componentWrapper('common');
echo '<jdoc:include type="component"></jdoc:include>'; } ?>
</div>
[2] In the template file templateDetails.xml
Add this line
<position>content</position>
into the list of positions so it shows up as a selectable template position in the module positions.
[3] Create a new file in the template /includes folder called joomlaposition_content.php
This file can be based on any joomlaposition_block_XXX.phpfile but be sure to chnage the function name to be _content
Typical content would be:
<?php function="" joomlaposition_content($caption,="" $content,="" $classes='' ,="" $id='' ,="" $extraclass='' )="" {="" $hascaption="(null" !="=" $caption="" &&="" strlen(trim($caption))=""?> 0);
$hasContent = (null !== $content && strlen(trim($content)) > 0);
$isPreview = $GLOBALS['theme_settings']['is_preview'];
if (!$hasCaption && !$hasContent)
return '';
if (!empty($id))
$id = $isPreview ? (' data-block-id="' . $id . '"') : '';
ob_start();
?>
<div class=" bd-block-6 <?php echo $classes; ?>"></div><?php echo="" $id;=""?>>
<div class="bd-container-inner">
<?php if="" ($hascaption)="" :=""?>
<div class=" bd-blockheader bd-tagstyles">
<h4><?php echo="" $caption;=""?></h4>
</div>
<?php endif;=""?>
<?php if="" ($hascontent)="" :=""?>
<div class="bd-blockcontent bd-tagstyles<?php echo $extraClass;?>">
<?php echo="" funcpostprocessblockcontent($content);=""?>
</div>
<?php endif;=""?>
</div>
<?php
return ob_get_clean();
}
that should be it. everything should work as before until you add a module to position "content" on a specific page, then its content will replace the normal joomla content. return="" ob_get_clean();="" }="" that="" should="" be="" it.="" everything="" should="" work="" as="" before="" until="" you="" add="" a="" module="" to="" position="" "content"="" on="" a="" specific="" page,="" then="" its="" content="" will="" replace="" the="" normal="" joomla=""?>
This modification will alow modules to be placed in a new position "content" when a page gets loaded with a module in the "content" position this module replaces any Joomla content that would have been published. This is useful if you want to remove any content from say the homepage, a landing page or even a single page and replace it with a module to provide the content. Specifically used for landing pages where you can have a set of promo module items replacing the normal Joomla blog content. This modification requires you going in and hacking the final template design and will get broken if you then go and edit that template through Themler. Inside the generated template do the following: [1] Find the /templates directory inside the Themler generated template zip file. You will need to change all /templates files you use in your templates find the code that outputs the joomla content: <div class="bd-container-inner"> <?php $document="JFactory::getDocument();" echo="" $document-=""?>view->renderSystemMessages(); $document->view->componentWrapper('common'); echo '<jdoc:include type="component"></jdoc:include>'; ?> </div> replace with this new code which checks for the presence of a module "content" and if it finds one displays it instead of the joomla content. <div class="bd-container-inner"> <?php $document="JFactory::getDocument();" echo="" $document-=""?>view->renderSystemMessages(); $document = JFactory::getDocument(); $view = $document->view; if ($view->containsModules('content') == 1) { echo buildDataPositionAttr('content'); echo $view->position('content', 'block%joomlaposition_content', '0'); } else { $document->view->componentWrapper('common'); echo '<jdoc:include type="component"></jdoc:include>'; } ?> </div> [2] In the template file templateDetails.xml Add this line <position>content</position> into the list of positions so it shows up as a selectable template position in the module positions. [3] Create a new file in the template /includes folder called joomlaposition_content.php This file can be based on any joomlaposition_block_XXX.phpfile but be sure to chnage the function name to be _content Typical content would be: <?php function="" joomlaposition_content($caption,="" $content,="" $classes='' ,="" $id='' ,="" $extraclass='' )="" {="" $hascaption="(null" !="=" $caption="" &&="" strlen(trim($caption))=""?> 0); $hasContent = (null !== $content && strlen(trim($content)) > 0); $isPreview = $GLOBALS['theme_settings']['is_preview']; if (!$hasCaption && !$hasContent) return ''; if (!empty($id)) $id = $isPreview ? (' data-block-id="' . $id . '"') : ''; ob_start(); ?> <div class=" bd-block-6 <?php echo $classes; ?>"></div><?php echo="" $id;=""?>> <div class="bd-container-inner"> <?php if="" ($hascaption)="" :=""?> <div class=" bd-blockheader bd-tagstyles"> <h4><?php echo="" $caption;=""?></h4> </div> <?php endif;=""?> <?php if="" ($hascontent)="" :=""?> <div class="bd-blockcontent bd-tagstyles<?php echo $extraClass;?>"> <?php echo="" funcpostprocessblockcontent($content);=""?> </div> <?php endif;=""?> </div> <?php return ob_get_clean(); } that should be it. everything should work as before until you add a module to position "content" on a specific page, then its content will replace the normal joomla content. return="" ob_get_clean();="" }="" that="" should="" be="" it.="" everything="" should="" work="" as="" before="" until="" you="" add="" a="" module="" to="" position="" "content"="" on="" a="" specific="" page,="" then="" its="" content="" will="" replace="" the="" normal="" joomla=""?>