Joomla Template – Front Page Component Modification

If you are having troubles like I have had over the last couple of hours finding a coding solution to the front page component with joomla. I have made a great work around which will enable you to fix the tags being randomly inserted and screwing up your columns and footer areas after the content panel.

It goes to show how powerful joomla templates can be. I have attached the solution along with a full explaination.The problem I have found is when adding a custom template to it is no problems dealing with articles as such. This of course is the case until you get the frontpage component integrated in to the site.

The frontpage component inherently adds a </div> tag at the end of the content column. This means any columns of footers after that get messed up. In turn I have made a solution which will correct the issue with as little php code as possible. see the solution below:

Started with:

<div id=”contentpanel”>
<div id=”content-panel”><jdoc:include type=”component” /></div>
<div id=”right-panel”><jdoc:include type=”modules” name=”right” style=”xhtml”/></div>

</div>

With a slight code change I have:
<? if ($_SERVER['REQUEST_URI'] == “/”) { ?>
<div id=”contentpanel”>
<div id=”content-panel”><jdoc:include type=”component” />
<div id=”right-panel”><jdoc:include type=”modules” name=”right” style=”xhtml”/></div>
</div>
<? }
else {?>
<div id=”contentpanel”>
<div id=”content-panel”><jdoc:include type=”component” /></div>
<div id=”right-panel”><jdoc:include type=”modules” name=”right” style=”xhtml”/></div>
</div>
<?}?>
With the small change it now works a treat