Remove the Mainbody from all Pages

July 08 Joomla Templates
GK User
Mon Nov 02, 2009 9:15 pm
Hi Please help. Is it possible to disable mainbody from all the pages in addition to the front page?
User avatar
Fresh Boarder

GK User
Mon Nov 02, 2009 9:30 pm
for all pages??
well, you can comment out whole mainbody area inside index.php
User avatar
Senior Boarder

GK User
Tue Nov 03, 2009 12:50 am
Hi

Basically, removing mainbody is not a good idea.. trust me. ;)

But...like we done in the last templates, you can use the mainbody as module position. This way, you will have more control options over mainbody.

To do this, follow this steps:

*** BACKUP FIRST ***

1) Open template_details.xml file and add mainbody position, like this:

Code: Select all
<position>mainbody</position>


2) Open index.php and find this code:

Code: Select all
<?php
// show mainbody on all subpages but not on frontpage
if (!$frontpage_i) :
?>
<div id="mainbody">
<jdoc:include type="component" />
</div>
<?php endif; ?>


replace with:

Code: Select all
<?php
// show mainbody on all subpages but not on frontpage
if (!($this->params->get("frontpage", 1) == 0 && $menu->getActive() == $menu->getDefault() && $this->countModules('mainbody + user4 + user5 + user6 + user9 + user10 + user11 + bottom') == 0 && $this->countModules($column_position) == 0)) :
?>
<?php
// show mainbody on all subpages but not on frontpage
if (!$frontpage_i || $this->countModules('mainbody')) :
?>
<div id="mainbody">
<?php if($this->countModules('mainbody')) : ?>
<jdoc:include type="modules" name="mainbody" style="gavickpro" />
<?php else: ?>
<jdoc:include type="component" />
</div>
<?php endif; ?>
<?php endif; ?>


Them find this line:

Code: Select all
<?php endif; ?>   
<!-- Footer -->


replace it with:

Code: Select all
<?php endif; ?>
<?php endif; ?>   
<!-- Footer -->


Now you can publish any module on mainbody position, so that component will be invisible, but (very important) existing anyway for other required links.

Cheers ;)
User avatar
Platinum Boarder


cron
Remember me
Register New Account
If you are old Gavick user, click HERE for steps to retrieve your account.