Jump to content

keeping navigation current

- - - - -

This topic has been archived. This means that you cannot reply to this topic.
1 reply to this topic

#1
yonghan

yonghan

    Learning Programmer

  • Members
  • PipPipPip
  • 99 posts
Hi all,i've found a nice code atA List Apart: Articles: Keeping Navigation Current With PHP..
What i'm askin is hot to make it as a function??There is no problem if i use it without making it as a function...Thanks a lot..

#2
DrennanSoftware

DrennanSoftware

    Newbie

  • Members
  • Pip
  • 1 posts
Hi Yonghan,

You would make it something like this:

<?php

function CurrentPage($Page)
{
      if ($thisPage==$Page)
      {
                echo " id=\"currentpage\"";
      }
}

?>

and you would use it like this:

<li<?php CurrentPage("Page One");?>>
      <a href="#">Page One</a></li>

I didn't read the full article so this may need tweaking, but I don't think it will. If you have any further questions please feel free to ask :)

Hoped it helped,

Matt