473,499 Members | 1,990 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

Multilevel site navigation

I am quite new to PHP and I my question is quite simple, but I have not
found any sufficient answer even after spending several hours in google or
reviewing this group.

I am planning a website, which is using an index.php, which has a structure
of the layout.
In this script I am planning to have several include() -statements.
One to generate the site navigation on the left margin.
Another to generate content in the mainarea of the page. The content is
stored in separate html-docs or php.-scripts, which are inserted into
index-page.
Variables, that are needed to pick the right content can be passed in the
url.

I will not use any database, because the content is quite static, but by
using php I am anyway looking for easier maintenance and updating.

My trouble is that I don't know how to generate a navigation that has three
levels, like this:
Item1 in first level ...Item1 in second level
....Item2 in second level
.......Item1 in third level
.......Item2 in third level
.......Item3 in third level
....Item3 in second level
Item2 in first level Item3 in first level Item4 in first level
....and so on....

When user enters the site, only main laevel's links are visible. When user
clicks an item on the first level, the content is updated with the
frontpage of this topic, but at the same time appropriate second level
links are displayed. And so on.
Of course I will use css to make links on different levels distinctive, so
there must be a way to set different class-value in <a> tag in different
levels.

I hope that you didn't fall asleep while reading this. If I failed to give
appropriate information, please ask.

Oll¡maX!
Jul 17 '05 #1
3 2107
take a look at my site, is that what you are talking about?
there are differnt levels to the tools menu

--
Mike Bradley
http://www.gzentools.com -- free online php tools
"OllimaX" <ol*****@sunpoint.net> wrote in message
news:op**************@news.inet.fi...
I am quite new to PHP and I my question is quite simple, but I have not
found any sufficient answer even after spending several hours in google or
reviewing this group.

I am planning a website, which is using an index.php, which has a structure of the layout.
In this script I am planning to have several include() -statements.
One to generate the site navigation on the left margin.
Another to generate content in the mainarea of the page. The content is
stored in separate html-docs or php.-scripts, which are inserted into
index-page.
Variables, that are needed to pick the right content can be passed in the
url.

I will not use any database, because the content is quite static, but by
using php I am anyway looking for easier maintenance and updating.

My trouble is that I don't know how to generate a navigation that has three levels, like this:
Item1 in first level ...Item1 in second level
...Item2 in second level
......Item1 in third level
......Item2 in third level
......Item3 in third level
...Item3 in second level
Item2 in first level Item3 in first level Item4 in first level
...and so on....

When user enters the site, only main laevel's links are visible. When user
clicks an item on the first level, the content is updated with the
frontpage of this topic, but at the same time appropriate second level
links are displayed. And so on.
Of course I will use css to make links on different levels distinctive, so
there must be a way to set different class-value in <a> tag in different
levels.

I hope that you didn't fall asleep while reading this. If I failed to give
appropriate information, please ask.

Oll¡maX!

Jul 17 '05 #2
CountScubula <me@scantek.hotmail.com> kirjoitti Thu, 15 Jan 2004 09:38:48
GMT:
take a look at my site, is that what you are talking about?
there are differnt levels to the tools menu

yes, more or less the same. You have the encoder tools expanded when
entering the site, I wouldn't have anything expanded at the first place,
but that's a minor problem of course. Also I need to have three levels
instead of yours two.
I can see you have done that with different scripts on each category.
That's a useful idea, although I was looking for a solution that one script
takes hold of each level and category. I have made some tests with
dimensional arrays like this:

$NAVI=array( 'History'=>
array('founding'=>'founding.php','sportsactivities '=>'sportacts.php'),
'Sports'=>
array('wrestling'=>array('licensepolicy'=>'license s.php','Wrestlers'=>'team.php')
,'bowling'=>'bowling');

In the array, key should be printed as a link, and value should be printed
as href. The reason why tehy have to be different is that the page is
actually going to be in finnish and there will be extended characters (like
&auml; and &ouml;) in linktext, so that I can't use the same text in href.

But iterating through this is a bit complicated, because at the same time
you have to take care that the right sections are expanded and I don't know
php well enought to make it func.

Olli Mäntyranta
Jul 17 '05 #3
Actauly the differtn scripts have nothing to do with it really.

The menu is one include file, and it looks for a cookie, example

at the top of any page i have an include head stuff., in it

$sm = $_COOKIE['sm']; //sm = show menu

then in my include menu file:

if ($sm != "item1")
{
print menu 1 title
}
else
{
print Menu 1 expanded
}
I just have a few of these

so, when you clicked on one of the menu options, the following page did this

setcookie("sm","item_name");
$sm = "item_name";

include (menu stuff)
you could do this with two or more levels by setting more cookies.

Now I know this is not the best way or wrost way to do it, but, it works for
me :)
--
Mike Bradley
http://www.gzentools.com -- free online php tools
"OllimaX" <ol*****@sunpoint.net> wrote in message
news:op**************@news.inet.fi...
CountScubula <me@scantek.hotmail.com> kirjoitti Thu, 15 Jan 2004 09:38:48
GMT:
take a look at my site, is that what you are talking about?
there are differnt levels to the tools menu

yes, more or less the same. You have the encoder tools expanded when
entering the site, I wouldn't have anything expanded at the first place,
but that's a minor problem of course. Also I need to have three levels
instead of yours two.
I can see you have done that with different scripts on each category.
That's a useful idea, although I was looking for a solution that one

script takes hold of each level and category. I have made some tests with
dimensional arrays like this:

$NAVI=array( 'History'=>
array('founding'=>'founding.php','sportsactivities '=>'sportacts.php'),
'Sports'=>
array('wrestling'=>array('licensepolicy'=>'license s.php','Wrestlers'=>'team.
php') ,'bowling'=>'bowling');

In the array, key should be printed as a link, and value should be printed
as href. The reason why tehy have to be different is that the page is
actually going to be in finnish and there will be extended characters (like &auml; and &ouml;) in linktext, so that I can't use the same text in href.

But iterating through this is a bit complicated, because at the same time
you have to take care that the right sections are expanded and I don't know php well enought to make it func.

Olli Mäntyranta

Jul 17 '05 #4

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

2
2397
by: Jeff Thies | last post by:
I have a site with javascript navigation menus (it's in the design spec). There's a bit too many pages to do a bread crumb type alternate nav, and no natural index page for each site section. ...
1
2746
by: Richard Jenkins | last post by:
Hi. I'd appreciate some comments/help with this site: http://www.moonremovals.co.uk/new The aim is to use css positioning to recreate something similar to: <table> <tr> <td...
71
4760
by: Murray R. Van Luyn | last post by:
Hi, Since I have made changes to my website it's been a complete flop. According to the logs, as soon as visitors have downloaded the index page they are off. I can't figure out why? ...
0
1305
by: nintesa | last post by:
I'm using Oscommerce, Joomla, Mambo ecc... everyone of these have a good multilevel admin panel. Now I'm developing a new indipendent little application ad I'm wondering if there is a small...
0
7220
jinu1996
by: jinu1996 | last post by:
In today's digital age, having a compelling online presence is paramount for businesses aiming to thrive in a competitive landscape. At the heart of this digital strategy lies an intricately woven...
0
7388
tracyyun
by: tracyyun | last post by:
Dear forum friends, With the development of smart home technology, a variety of wireless communication protocols have appeared on the market, such as Zigbee, Z-Wave, Wi-Fi, Bluetooth, etc. Each...
0
5470
agi2029
by: agi2029 | last post by:
Let's talk about the concept of autonomous AI software engineers and no-code agents. These AIs are designed to manage the entire lifecycle of a software development project—planning, coding, testing,...
1
4919
isladogs
by: isladogs | last post by:
The next Access Europe User Group meeting will be on Wednesday 1 May 2024 starting at 18:00 UK time (6PM UTC+1) and finishing by 19:30 (7.30PM). In this session, we are pleased to welcome a new...
0
4600
by: conductexam | last post by:
I have .net C# application in which I am extracting data from word file and save it in database particularly. To store word all data as it is I am converting the whole word file firstly in HTML and...
0
3099
by: TSSRALBI | last post by:
Hello I'm a network technician in training and I need your help. I am currently learning how to create and manage the different types of VPNs and I have a question about LAN-to-LAN VPNs. The...
0
3091
by: adsilva | last post by:
A Windows Forms form does not have the event Unload, like VB6. What one acts like?
0
1427
by: 6302768590 | last post by:
Hai team i want code for transfer the data from one system to another through IP address by using C# our system has to for every 5mins then we have to update the data what the data is updated ...
1
665
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.