Jump to content

navigation menu


mrjoaopereira

Recommended Posts

<ul id="navigation">

<li <?php if ($page=='index.php') echo 'class=aktiv'?> ><a href="index.php">home</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='gallery.php') echo 'class=aktiv'?> ><a href="gallery.php">gallery</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='portfolio.php') echo 'class=aktiv'?> ><a href="portfolio.php">portfolio</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='about.php') echo 'class=aktiv'?> ><a href="about.php">about</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='contact.php') echo 'class=aktiv'?> ><a href="contact.php">contact</a></li>

</ul>

 

 

Followed by:

 

<?php

$page ="index.php";

include("includes/header.php");

?>

 

on the source stopped working and i cant figure it out.

possible to get some help

 

i get this error on validating :

Error  Line 18, Column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified

 

<li class=aktiv ><a href="index.php">home</a></li>

being a sort of a noobie i cant figure it out...

 

ty,

joao

Link to comment
Share on other sites

Add the following code at the top of your page right after the <?php element, and see if it reports any errors:

ini_set('display_errors',1);
error_reporting(E_ALL);

 

What error are you exactly getting, is that all your code? What are you expecting to get? You're not giving us a lot to work with.

 

Link to comment
Share on other sites

i dont get any errors...

i do get the error i updated above on validating the page on http://validator.w3.org

 

Error  Line 18, Column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified

 

<li class=aktiv ><a href="index.php">home</a></li>

 

erm... if the php is right why doesnt it work?

 

Here goes full code:

<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">

<html xmlns="http://www.w3.org/1999/xhtml">

 

<head>

<title>Joao Paulo Vieira Pereira</title>

<meta http-equiv="content-type" content="text/html;charset=utf-8"/>

    <meta name="keywords" content="Joao Pereira, Personal Website"/>

    <link rel="stylesheet" href="css/style.css" type="text/css"/

</head>

 

<body>

<div id="background">

</div>

<div id="page-wrapper">

<div id="content-wrapper" class="clearfix">

<div id="header">

<ul id="navigation">

<li <?php if ($page=='index.php') echo 'class=aktiv'?> ><a href="index.php">home</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='gallery.php') echo 'class=aktiv'?> ><a href="gallery.php">gallery</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='portfolio.php') echo 'class=aktiv'?> ><a href="portfolio.php">portfolio</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='about.php') echo 'class=aktiv'?> ><a href="about.php">about</a></li>

<li class="trenner">/</li>

<li <?php if ($page=='contact.php') echo 'class=aktiv'?> ><a href="contact.php">contact</a></li>

</ul>

<h1><span class="bauhaus gray-222 mega bold">Joao Pereira</span></h1>

</div>

 

this is for my header include.

the php is minimum but i am learning that is the way right?

Link to comment
Share on other sites

i dont get any errors...

i do get the error i updated above on validating the page on http://validator.w3.org

 

Error  Line 18, Column 13: an attribute value specification must be an attribute value literal unless SHORTTAG YES is specified

 

<li class=aktiv ><a href="index.php">home</a></li>

 

erm... if the php is right why doesnt it work?

 

Just a note, the validator does not do anything to the php, nor does it tell you of any errors, just html stuff.

 

And yes, upon looking at your code the IF statements are incorrect, they should be:

  
<?php
$page ="index.php";
include("includes/header.php");
?>

<ul id="navigation">
      <li <?php if ($page=='index.php') { echo 'class=aktiv'; }?> ><a href="index.php">home</a></li>
      <li class="trenner">/</li>
      <li <?php if ($page=='gallery.php') { echo 'class=aktiv'; } ?> ><a href="gallery.php">gallery</a></li>
      <li class="trenner">/</li>
      <li <?php if ($page=='portfolio.php') { echo 'class=aktiv'; } ?> ><a href="portfolio.php">portfolio</a></li>
      <li class="trenner">/</li>
      <li <?php if ($page=='about.php') { echo 'class=aktiv'; } ?> ><a href="about.php">about</a></li>
      <li class="trenner">/</li>
      <li <?php if ($page=='contact.php') { echo 'class=aktiv'; }?> ><a href="contact.php">contact</a></li>
   </ul>

 

.. PHP error reporting would tell you this.

Link to comment
Share on other sites

#header #navigation li a.aktiv {

color:#000;

font-family:Arial, Helvetica, sans-serif;

font-size: 25px;

cursor: default;

}

 

thats my css for the class

 

it does make a diference, but in any case im just bugged why i cant make it work

 

css correct, xhtml correct, php seems correct yet it doesnt work, aha!!

 

if u wanna check if for some reason it doesnt work only for me

 

www.ojoao.com its under construction so most of the links arent working but you should see the home page

Link to comment
Share on other sites

no no!

the source starts with :

<?php

$page="index.php";

include("includes/header.php");

?> 

 

the navigation coding you see in the include file.

im going to leave it as it is though without the class as i am getting late to present this site done on wed...

 

From looking at the source, it appears index.php has the 'active' class on, You'd need to make those other links if you want to test if the other ones work, because from what I can see, your code is solid.

Link to comment
Share on other sites

You dont need PHP to style your aktive links you can do it all through css

 

Just define a class for the active page

.page {
padding: 5px 9px 5px 9px;
color: #999;
font-family: 'Century Gothic';
font-weight: normal;
text-decoration: none;
background-color: #141414;
border: solid #990000 2px;
-moz-border-radius: 5px; 
-webkit-border-radius: 5px; 
border-radius: 5px;
}

 

Then just ad a span to it like this

 

 

<li><a href="index.html"><span class="page">HOME</span></a></li>

 

Id your menu dynamically driven?

 

Link to comment
Share on other sites

This thread is more than a year old. Please don't revive it unless you have something important to add.

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

We have placed cookies on your device to help make this website better. You can adjust your cookie settings, otherwise we'll assume you're okay to continue.