Side navigation
am 05.10.2007 20:00:34 von ikkjespam.salve
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!
--
Salve Håkedal
Re: Side navigation
am 05.10.2007 20:14:07 von Shelly
"Salve Håkedal" wrote in message
news:QIydnd96g4tf5pvaRVnzvQA@telenor.com...
> 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!
>
> --
> Salve Håkedal
What is your purpose in putting each file in its own sub-sub-sub-etc.
directory? In fact, why are you putting any of these in subdirectories.
Why not simply have the top level for Band be band.php? Unless you are
going to search over files in a given directory, I see no reason for the
added complications.
Example: I have a site that has customers that placed an order for
pictures. So, when the order is placed, I create a folder under a "photos"
folder and call that folder by the order number. I then place the pictures
for that order in that folder. That makes it easy to have a pointer to that
directory and to delete them when needed.
I see no such reason for doing so with your source code. Perhaps you might
want a separate folder for Band and Theater for clarity. I just don't see
any reason for going deeper than that. If you ahve a valid reason for doing
so, please enlighten me.
BTW, using relative paths works well.
Shelly
Re: Side navigation
am 05.10.2007 21:16:40 von ikkjespam.salve
On 2007-10-05, Shelly wrote:
>
> "Salve Håkedal" wrote in message
> news:QIydnd96g4tf5pvaRVnzvQA@telenor.com...
>> 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!
>>
>> --
>> Salve Håkedal
>
> What is your purpose in putting each file in its own sub-sub-sub-etc.
> directory? In fact, why are you putting any of these in
> subdirectories. Why not simply have the top level for Band be
> band.php? Unless you are going to search over files in a given
> directory, I see no reason for the added complications.
>
> Example: I have a site that has customers that placed an order for
> pictures. So, when the order is placed, I create a folder under a
> "photos" folder and call that folder by the order number. I then
> place the pictures for that order in that folder. That makes it easy
> to have a pointer to that directory and to delete them when needed.
>
> I see no such reason for doing so with your source code. Perhaps you
> might want a separate folder for Band and Theater for clarity. I just
> don't see any reason for going deeper than that. If you ahve a valid
> reason for doing so, please enlighten me.
>
> BTW, using relative paths works well.
>
> Shelly
>
You may be right, but I shure want _one_ level of subdirectories, to
keep it tidy!
How would nice code for that look, then?
--
Salve Håkedal
Re: Side navigation
am 05.10.2007 21:22:24 von henri
On Fri, 05 Oct 2007 13:00:34 -0500, 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!
>
what you can do is get the current path and explode it, then you can
always figure out on what page you are and in which directory etc and you
echo your stuff accordingly. It's pretty straightforward.
Re: Side navigation
am 06.10.2007 02:35:34 von Jerry Stuckle
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.
Or
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
==================
Re: Side navigation
am 06.10.2007 06:14:55 von Shelly
"Jerry Stuckle" wrote in message
news:YoOdnX-zcpzERZvanZ2dnUVZ_vGinZ2d@comcast.com...
> 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.
>
>
>
> Or
>
>
>
You are missing a couple of closing parentheses.
Shelly
Re: Side navigation
am 06.10.2007 07:14:11 von Jerry Stuckle
Shelly wrote:
> "Jerry Stuckle" wrote in message
> news:YoOdnX-zcpzERZvanZ2dnUVZ_vGinZ2d@comcast.com...
>> 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.
>>
>>
>>
>> Or
>>
>>
>>
>
> You are missing a couple of closing parentheses.
>
> Shelly
>
>
Yea, I was tired last night :-)
--
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================