473,503 Members | 2,166 Online
Bytes | Software Development & Data Engineering Community
+ Post

Home Posts Topics Members FAQ

outputting a navigation menu

Hello,
I'm working on a new site and i'd like to have a navigation menu on it.
Ideally i'm thinking:

home
first item
second item
etc

obviously with different names. I could use echo to output each line, but i
would rather use one echo statement combined with a for loop to get each
item as in:

for ($x = 1; $x <= 3; $x++) {
echo "<li><a href='filename.php'Item $x</a></li>";

and get the items from another point in the file or another file. I am
uncertain how to do this. Am i overthinking this?
Thanks.
Dave.
Dec 17 '07 #1
1 1582
Dave wrote:
Hello,
I'm working on a new site and i'd like to have a navigation menu on it.
Ideally i'm thinking:

home
first item
second item
etc

obviously with different names. I could use echo to output each line, but i
would rather use one echo statement combined with a for loop to get each
item as in:

for ($x = 1; $x <= 3; $x++) {
echo "<li><a href='filename.php'Item $x</a></li>";

and get the items from another point in the file or another file. I am
uncertain how to do this. Am i overthinking this?
Thanks.
Dave.
Hi, Dave,

Maybe.

The first question I would have is - why do you want this? Because it's
neat, or because you need dynamic menus?

Normally I try to keep my menus fairly constant - people come to expect
this. What I do change is submenus, i.e.

Menu Item 1
Menu Item 2
Menu Item 2.1
Menu Item 2.2
Menu Item 2.3
Menu Item 3
Menu Item 4

Etc. Expand the menu as necessary to get the submenu items. Everything
goes in one menu file which is included in the rest.

If I do truly need dynamic menu items, I use a database such as MySQL to
store the info about each item as well as the criteria for displaying
it. A little more complicated to program, but over all easier to make
changes in the menu items.

Beyond that, I'm not sure what you're asking.

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

Dec 17 '07 #2

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

Similar topics

4
3910
by: Dave Patton | last post by:
Using my About page as an example: http://members.shaw.ca/davepatton/about.html What is the best/proper way to markup a page such as this that has "the main body" and "a navigation menu"? It...
22
11058
by: Marek Mand | last post by:
How to create a functional *flexible* UL-menu list <div> <ul> <li><a href=""></li> <li><a href=""></li> <li><a href=""></li> </ul> </div> (working in IE, Mozilla1.6, Opera7 (or maybe even...
3
2369
by: eternalD3 | last post by:
Hi, I have a problem to get this working on Opera 7.x+. This does not need to work on older Opera browsers There are problems on rendering the sub-level navigation. It aligns right on Firefox...
0
2110
by: Veli-Pekka Tätilä | last post by:
Hi, My first post here. I've found some serious accessibility flaws in the Python 2.4 docs and wish they could be rectified over time. I'm very new to Python and initially contacted docs at python...
2
1615
by: Sisnaz | last post by:
I'm working with 2005 Beta 2 and I'm sure this is a trivial question but for the life of me I can't figure out. I placed a menu navigation componet on my master page and defined the navigation...
10
2514
by: EA | last post by:
I am sure I must be missing something about building navigation bars with CSS. Yes it is a very clever and efficient way to format navigation structures on simple one navigation level webs, i.e....
4
3978
by: tburger | last post by:
Hey everyone- This is my first post at The Scripts, but I've used the forums before for other programming issues. Hopefully, someone has some solid styling advice for me. I've now been dealing...
1
7691
by: Fabx | last post by:
Hallo, sorry for my english. I want to build a navigation menu with the repeat control, the items of menu are in a table of database. All items of the menu have class="MenuLink", but the...
2
1760
tharden3
by: tharden3 | last post by:
I have a question for you guys, I'm designing a website. Before I go any further, I'd like to get my navigation bars on the left side up and running. The site is themed to a bumblebee 'black and...
0
7205
marktang
by: marktang | last post by:
ONU (Optical Network Unit) is one of the key components for providing high-speed Internet services. Its primary function is to act as an endpoint device located at the user's premises. However,...
0
7093
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...
0
7287
Oralloy
by: Oralloy | last post by:
Hello folks, I am unable to find appropriate documentation on the type promotion of bit-fields when using the generalised comparison operator "<=>". The problem is that using the GNU compilers,...
0
7353
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...
1
7011
by: Hystou | last post by:
Overview: Windows 11 and 10 have less user interface control over operating system update behaviour than previous versions of Windows. In Windows 11 and 10, there is no way to turn off the Windows...
0
5596
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
5023
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...
1
747
muto222
by: muto222 | last post by:
How can i add a mobile payment intergratation into php mysql website.
0
401
bsmnconsultancy
by: bsmnconsultancy | last post by:
In today's digital era, a well-designed website is crucial for businesses looking to succeed. Whether you're a small business owner or a large corporation in Toronto, having a strong online presence...

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.