Different background for frontpage/homepage

I want to have a different layout for the home page than the rest of the website, mainly the background color for the home page (this should be different from the one for the logged in page).  The topbar and the footer can remain the same, but i want the entire body background to change.

I have tried changing the body color by using defining the CSS in the custom index file, but that seems to change the background color once I log on as well.  I have also tried adding a new page_element/header.php in the custom index file, but that seems to affect the entire site as well and not just the home page.

Can you give me a pointer as to how to accomplish this?

 

  • Write your own CSS for this then point to this in your custom_index

  • Hi Goofbucket, thanks for your reply, but... This is going to be a really newbie question,

    how/where do I do that? Do I create a new page header for it or somewhere within the start.php?

  • ys create a new page headr. develop it as apluggin. so it will b upgrade friendly

  • Ok Just an update on how i fixed this.

    I eventually copied the page_elements/header.php file to the customindex plugin. After that I placed my custom css location in an !isloggedin() (not logged in) statement to determine if it was a logged in user or not. This is what the css location declaration in my header.php looks like now

    <?php
        if (!isloggedin()) {
    ?>
        <!-- include the default css file -->
        <link rel="stylesheet" href="<?php echo $vars['url']; ?>mod/customindex/views/default/customindex/new.css" type="text/css" />
    <?php
        }
    ?>

    <?php
        if (isloggedin()) {
    ?>
        <!-- include the default css file -->
        <link rel="stylesheet" href="<?php echo $vars['url']; ?>_css/css.css?lastcache=<?php echo $vars['config']->lastcache; ?>&viewtype=<?php echo $vars['view']; ?>" type="text/css" />
    <?php
        }
    ?>   

     

    Not sure if this is the most elegant solution (not much of a programmer), but it works :)