You are here: Re: Side navigation « PHP Programming Language « IT news, forums, messages
Re: Side navigation

Posted by Jerry Stuckle on 10/06/07 00:35

Salve Håkedal wrote:
> I'm going to make a small site whith a structure something
> like this:
>
> Navigation: | Files:
> Home | index.php, in the web-page root directory
> About us | about_us.php, in the web-page root directory
> Band | referring to index.php in subdirectory
> Theatre group | referring to index.php in another subdirectory
>
> The subdirectories should be able to contain subdirectories...
>
> I want 2 things to happen in the navigaton:
> 1. If for example Home is the active page, it should not be a
> hyperlink.
>
> 2. If pages f.ex. in Band directory is the active page
> (not if it's index.php in its directory), it too should appear
> with its title not a hyperlink, AND with each level in its
> path as hyperlinks, like this:
> Home
> About us
> Band
> dirlevel (of bands directory)
> subdirlevel
> active file
> Theatre group
>
> ---
> I can't figure this out easily, but I'm shure it has been done
> before!
>

A couple of easy possibilities.

The easiest would be to set a constant in the beginning of each file,
and switch on it, i.e.

<?php define('thispage', 'home';?>

Or

<?php define('thispage', 'band';?>

and generate your code based on $thispage. It's independent of file
location and you can have multiple pages with the same text, but you do
have to maintain the constants.

Alternative, you can base the information on the __FILE__ predefined
variable. This means you don't have to maintain define() statements as
above, but now you're going to be dependent on the file location.


--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

 

Navigation:

[Reply to this message]


Удаленная работа для программистов  •  Как заработать на Google AdSense  •  England, UK  •  статьи на английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Сайт изготовлен в Студии Валентина Петручека
изготовление и поддержка веб-сайтов, разработка программного обеспечения, поисковая оптимизация