Background

  • tamarae11
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
9 years 9 months ago #40020 by tamarae11
Background was created by tamarae11
Hello.

Is there a way to have a background only on the home page and not on the inside pages of the site? I would like the home page to have a full background, but I would like the inside pages to remain white. Please help

Please Log in to join the conversation.

More
9 years 9 months ago #40023 by ivan.milic
Replied by ivan.milic on topic Background
You could edit index.php to add some css class to body tag when you are on home page like <bode class="home"...

Here is ref how to check if you are on homepage :

docs.joomla.org/How_to_determine_if_the_...ewing_the_front_page

Then in template_css.css add this:

body{
background:none;
}

body.home{
background: #FFFFFF url(/vortex/templates/hot_vortex/images/bg_1.jpg) top center;
}

Please Log in to join the conversation.

  • tamarae11
    Inactive member
  • Topic Author
  • New Member
  • New Member
More
9 years 9 months ago #40034 by tamarae11
Replied by tamarae11 on topic Background
Hello

Thank you for quick response. I'm not very good at writing/editing php.. can you please tell me exactly what to add to the index.php file so that I won't mess it up. I tried adding a "class" that I thought was right, but it didnt work. Any help you can provide would be appreciated.

Please Log in to join the conversation.

More
9 years 9 months ago #40036 by ivan.milic
Replied by ivan.milic on topic Background
So where you see :

<body

replace with :

<?php
$app = JFactory::getApplication();
$menu = $app->getMenu();
$lang = JFactory::getLanguage();
$body_class = "inner";
if ($menu->getActive() == $menu->getDefault($lang->getTag())) {
$body_class = "home";
}
?>
<body class="<?php echo $body_class; ?>"

Please Log in to join the conversation.

Time to create page: 0.315 seconds
Powered by Kunena Forum