Welcome to Dream.In.Code
Getting PHP Help is Easy!

Join 136,492 PHP Programmers for FREE! Get instant access to thousands of PHP experts, tutorials, code snippets, and more! There are 1,720 people online right now. Registration is fast and FREE... Join Now!




PHP / CSS : Active Section & Topic Highligting

 
Reply to this topicStart new topic

PHP / CSS : Active Section & Topic Highligting, Cant seem to get my code right on this one...

parenteau
3 Mar, 2008 - 10:43 PM
Post #1

New D.I.C Head
Group Icon

Joined: 12 Feb, 2008
Posts: 28


Dream Kudos: 50
My Contributions
I don't know what I am doing wrong here. I am pretty new at this and want to basically use css and php for a project. So I have been creating this template. I have everything working the way I want it and will start to develop content and rearrange after my understanding is a bit better... now the only hting I can't seem to get right is the active section and Topic highlighting. The a:hover is right the css is right... somewhere I am not doing something right. here is the site page:

http://www.clubinfinite.com

here is the code:

CODE
<?php $thisSection="Home"; ?>      
<?php
    $thisWebsite="Illustrating in CSS & php";
    $page1="Home";
    $page2="About";
    $page3="Portfolio";
    $page4="Recent News";
    $page5="Contact";
    $topic1="Welcome";
    $topic2="Topic Two";
    $topic3="Topic Three";
    $topic4="Topic Four";
    $topic5="Topic Five";
    ?>        
        
<html xmlns="http://www.w3.org/1999/xhtml">

<head>
      <div id="container">
        <title><?php echo "$thisWebsite"; ?><?php echo " | $thisSection"; ?><?php echo " | $thisTopic"; ?></title>
        <link rel="stylesheet" type="text/css" href="default.css"
</head>

<body class="topic-1">


    <div id="masthead"><h1><?php echo "$thisWebsite"; ?></h1></div>


    <div id="main-menu">
        <ul>
            <li<?php if ($thisSection=="Home") echo " id=\"active-selection\""; ?>><a href="#" title="Home">Home</a></li>
            <li<?php if ($thisSection=="About") echo " id=\"active-selection\""; ?>><a href="#" title="About">About</a></li>
            <li<?php if ($thisSection=="Portfolio") echo " id=\"active-selection\""; ?>><a href="#" title="Portfolio">Portfolio</a></li>
            <li<?php if ($thisSection=="Recent News") echo " id=\"active-selection\""; ?>><a href="#" title="Process">Process</a></li>
            <li<?php if ($thisSection=="Contact") echo " id=\"active-selection\""; ?>><a href="#" title="Contact">Contact</a></li>
        </ul>
    </div>

    <div id="page-column">
        <ul>
            <li<?php if ($thisTopic=="Welcome") echo " id=\"active-topic\""; ?>><a href="#" title="Welcome"><?php echo "$topic1"; ?></a></li>
            <li<?php if ($thisTopic=="topic2") echo " id=\"active-topic\""; ?>><a href="#" title="topic2"><?php echo "$topic2"; ?></a></li>
            <li<?php if ($thisTopic=="topic3") echo " id=\"active-topic\""; ?>><a href="#" title="topic3"><?php echo "$topic3"; ?></a></li>
            <li<?php if ($thisTopic=="topic4") echo " id=\"active-topic\""; ?>><a href="#" title="topic4"><?php echo "$topic4"; ?></a></li>
            <li<?php if ($thisTopic=="topic5") echo " id=\"active-topic\""; ?>><a href="#" title="topic5"><?php echo "$topic5"; ?></a></li>
        </ul>
    </div>
    
    
    <div id="page-contents">
    <?php $thisTopic="Welcome"; ?>
        <h2>Welcome to My Illustrations in CSS</h2>


        <p>For years now, I have been illustrating and painting. I am now trying to find a way to do so in code and am totally passionate about it! This small web application is an exercise to illustrate a site with CSS and php.
        </p>
    </div>

    <div id="footer"><p class="text-small"><?php echo "$thisWebsite"; ?> Copyright 2008 Michael Parenteau. All Rights Reserved.</p></div>

</body>


here is the stylesheet reference:

CODE
#main-menu ul li#active-selection a
      {background: #521508;
      }

#page-column ul li#active-topic a
    {
    background: #CCC;
    }


Thanks in advance for any help you can spare!!! I appreciate it.

This post has been edited by parenteau: 3 Mar, 2008 - 10:46 PM
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: PHP / CSS : Active Section & Topic Highligting
3 Mar, 2008 - 10:47 PM
Post #2

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,465



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
Why do you have a <div> in the <head>??
User is online!Profile CardPM
+Quote Post

parenteau
RE: PHP / CSS : Active Section & Topic Highligting
3 Mar, 2008 - 10:59 PM
Post #3

New D.I.C Head
Group Icon

Joined: 12 Feb, 2008
Posts: 28


Dream Kudos: 50
My Contributions
I am totally new at the developer end of things!!! Thank you for pointing that out to me, I moved the
CODE
<div>
to the
CODE
<body>
... But that didn't change my situation. Do you see where I am going wrong here... I feel like I am not too far from getting this. Maybe I am way off though. I had the sections highlighted in my html version... but now that I am trying to recreate w/ php & css... I have come across some speed bumps.

This post has been edited by parenteau: 3 Mar, 2008 - 11:00 PM
User is offlineProfile CardPM
+Quote Post

didgy58
RE: PHP / CSS : Active Section & Topic Highligting
4 Mar, 2008 - 01:58 AM
Post #4

D.I.C Head
**

Joined: 23 Oct, 2007
Posts: 170



Thanked: 1 times
My Contributions
i dont quite understand, when i hove over the tags they change color? what problem are you having?just call me stupid
User is offlineProfile CardPM
+Quote Post

no2pencil
RE: PHP / CSS : Active Section & Topic Highligting
4 Mar, 2008 - 02:08 AM
Post #5

My fridge be runnin OH NOEZ!
Group Icon

Joined: 10 May, 2007
Posts: 6,465



Thanked: 66 times
Dream Kudos: 2425
Expert In: Goofing Off

My Contributions
QUOTE(didgy58 @ 4 Mar, 2008 - 02:58 AM) *

i dont quite understand, when i hove over the tags they change color? what problem are you having?just call me stupid

Maybe it's a browser specific bug?
User is online!Profile CardPM
+Quote Post

parenteau
RE: PHP / CSS : Active Section & Topic Highligting
4 Mar, 2008 - 08:20 AM
Post #6

New D.I.C Head
Group Icon

Joined: 12 Feb, 2008
Posts: 28


Dream Kudos: 50
My Contributions
QUOTE(no2pencil @ 4 Mar, 2008 - 03:08 AM) *

QUOTE(didgy58 @ 4 Mar, 2008 - 02:58 AM) *

i dont quite understand, when i hove over the tags they change color? what problem are you having?just call me stupid

Maybe it's a browser specific bug?


I got the hovering... it is the active page / topic highlighting....
I have the "home section highlighted in red... I wanted to have the topic "welcome" to be highlighted the color it is when hovered while it is active...
I don't know where I am missing something.
User is offlineProfile CardPM
+Quote Post

parenteau
RE: PHP / CSS : Active Section & Topic Highligting
4 Mar, 2008 - 08:49 AM
Post #7

New D.I.C Head
Group Icon

Joined: 12 Feb, 2008
Posts: 28


Dream Kudos: 50
My Contributions
figured it out...
I needed to define the active page in the beginning of the document.

CODE
<?php $thisSection="Home";
       $thisTopic="Welcome"; ?>

User is offlineProfile CardPM
+Quote Post

Fast ReplyReply to this topicStart new topic
Time is now: 12/2/08 07:45PM

Live PHP Help!

PHP Tutorials

Reference Sheets

PHP Snippets

DIC Chatroom

Bye Bye Ads

Monthly Drawing

Thumb Drive

Top Contributors

Top 10 Kudos This Month