Mainbody component verbergen op homepage

Vragen over templates en CSS op Joomla! 2.5

Moderator: pe7er

Forum rules
Forum Regels
nieuwsmag
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 145
Joined: Thu Nov 06, 2008 11:25 am

Mainbody component verbergen op homepage

Postby nieuwsmag » Sat Dec 21, 2013 2:21 pm

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?
You do not have the required permissions to view the files attached to this post.

User avatar
3dgtech
Joomla! Guru
Joomla! Guru
Posts: 546
Joined: Mon Feb 08, 2010 4:15 pm
Location: Cleveland, Ohio
Contact:

Re: Mainbody component verbergen op homepage

Postby 3dgtech » Sun Dec 22, 2013 2:34 am

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)
Eli Aschkenasy
http://themodularway.com

nieuwsmag
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 145
Joined: Thu Nov 06, 2008 11:25 am

Re: Mainbody component verbergen op homepage

Postby nieuwsmag » Tue Jan 14, 2014 8:46 pm

Niet meer van toepassing

User avatar
3dgtech
Joomla! Guru
Joomla! Guru
Posts: 546
Joined: Mon Feb 08, 2010 4:15 pm
Location: Cleveland, Ohio
Contact:

Re: Mainbody component verbergen op homepage

Postby 3dgtech » Tue Jan 14, 2014 9:07 pm

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)
Eli Aschkenasy
http://themodularway.com

nieuwsmag
Joomla! Enthusiast
Joomla! Enthusiast
Posts: 145
Joined: Thu Nov 06, 2008 11:25 am

Re: Mainbody component verbergen op homepage

Postby nieuwsmag » Tue Jan 14, 2014 9:13 pm

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 :)

User avatar
3dgtech
Joomla! Guru
Joomla! Guru
Posts: 546
Joined: Mon Feb 08, 2010 4:15 pm
Location: Cleveland, Ohio
Contact:

Re: Mainbody component verbergen op homepage

Postby 3dgtech » Tue Jan 14, 2014 9:20 pm

for more information, you can read this joomla page:
http://docs.joomla.org/How_to_determine_if_the_user_is_viewing_the_front_page
Eli Aschkenasy
http://themodularway.com

User avatar
3dgtech
Joomla! Guru
Joomla! Guru
Posts: 546
Joined: Mon Feb 08, 2010 4:15 pm
Location: Cleveland, Ohio
Contact:

Re: Mainbody component verbergen op homepage

Postby 3dgtech » Tue Jan 14, 2014 9:22 pm

@nieuwsmag I hope to see you at jdnl14...
Eli Aschkenasy
http://themodularway.com


Return to “Templates 2.5”

Who is online

Users browsing this forum: No registered users and 1 guest