Page 1 of 1

Mainbody component verbergen op homepage

Posted: Sat Dec 21, 2013 2:21 pm
by nieuwsmag
Hallo,

Ik wil graag op de homepagina alleen modules hebben en geen artikels. Ik heb via google al meerdere suggesties gevonden maar niets werkt.

Ik werk met template jp_studio maar ik krijg het niet voor elkaar om de mainbody te verwijderen.

Ik heb al de 'blank component' geïnstalleerd, dan zie ik inderdaad geen tekst maar de mainbody blijft wel zichtbaar.
component.png
Weet iemand hoe ik dit weg krijg?

Re: Mainbody component verbergen op homepage

Posted: Sun Dec 22, 2013 2:34 am
by 3dgtech
you can change the index.php file of your template to check if this is the default menu and omit the system output if it is. (simple php if clause)

Re: Mainbody component verbergen op homepage

Posted: Tue Jan 14, 2014 8:46 pm
by nieuwsmag
Niet meer van toepassing

Re: Mainbody component verbergen op homepage

Posted: Tue Jan 14, 2014 9:07 pm
by 3dgtech
why is this not applicable?

Code: Select all

<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
$lang = JFactory::getLanguage();
if ($menu->getActive() == $menu->getDefault($lang->getTag())) {
    // this is frontpage
} else {
    // this is not the frontpage
    <jdoc:include type="message" />
    <jdoc:include type="component" />
}
?>
when adding this to a templates index.php file, at the line where you usually have the plain jdoc:include statements, it will check if the current page is the front page of any of the languages (accommodating multilingual sites)

Re: Mainbody component verbergen op homepage

Posted: Tue Jan 14, 2014 9:13 pm
by nieuwsmag
3dgtech wrote:why is this not applicable?

Code: Select all

<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
$lang = JFactory::getLanguage();
if ($menu->getActive() == $menu->getDefault($lang->getTag())) {
    // this is frontpage
} else {
    // this is not the frontpage
    <jdoc:include type="message" />
    <jdoc:include type="component" />
}
?>
when adding this to a templates index.php file, at the line where you usually have the plain jdoc:include statements, it will check if the current page is the front page of any of the languages (accommodating multilingual sites)
Thanks :)

Re: Mainbody component verbergen op homepage

Posted: Tue Jan 14, 2014 9:20 pm
by 3dgtech
for more information, you can read this joomla page:
http://docs.joomla.org/How_to_determine ... front_page

Re: Mainbody component verbergen op homepage

Posted: Tue Jan 14, 2014 9:22 pm
by 3dgtech
@nieuwsmag I hope to see you at jdnl14...