/    Sign up×
Community /Pin to ProfileBookmark

navigation menu

i have a navigation menu which i would like it to appear at the top of every page i have in my website.

Do I have to paste the navigation code on each and every html page or shall i use frames so that i have the navigation menu code only once ?

Thanks for any advice!

to post a comment
HTML

6 Comments(s)

Copy linkTweet thisAlerts:
@DaveSWSep 23.2004 — you can use server side coding to do this if you have something available, e.g. SSI or php. Do you have either of those?
Copy linkTweet thisAlerts:
@CassiusauthorSep 23.2004 — well not really, i'm simply building a simple website using HTML/CSS/JavaScript.

Actually, I am aware that Frames are not so common among web developers, but in this situation I saw them as the better way to avoid redundant code.

What do you think ?
Copy linkTweet thisAlerts:
@DaveSWSep 23.2004 — when I said available I meant does your server support them, rather than if you knew those languages. Basically they will save you lots of time and make your site more accessible if you use them as opposed to frames or javascript, neither of which are recomended for essential page functions like navigation...
Copy linkTweet thisAlerts:
@NogDogSep 23.2004 — I think you could put the navigation code into a file such as "nav.html", then just add an include in each file where you want that navigation to appear:
<!--#include file="nav.html"-->
I've done my web site in PHP, and have the top and bottom parts of my pages which are more-or-less constant defined as functions in a separate file which is included in each page via the PHP "include" function. Then at the appropriate point in each page I just call the relevant function, such as:
[code=php]page_top("Page Title");[/code]
Copy linkTweet thisAlerts:
@johndoe190Sep 23.2004 — Nogdog and dave are right if you have them enabled on your server use the line of code that nogdog gave you dont use frames as they are inaccessible and bad for SEO.

<?php require(header.txt); ?>

The above code would be the php equivelent.
Copy linkTweet thisAlerts:
@CassiusauthorSep 24.2004 — Thank you very much for all of your responses ... PHP was on my "To Learn" list, therefore it's time to start learning it ?
×

Success!

Help @Cassius spread the word by sharing this article on Twitter...

Tweet This
Sign in
Forgot password?
Sign in with TwitchSign in with GithubCreate Account
about: ({
version: 0.1.9 BETA 5.17,
whats_new: community page,
up_next: more Davinci•003 tasks,
coming_soon: events calendar,
social: @webDeveloperHQ
});

legal: ({
terms: of use,
privacy: policy
});
changelog: (
version: 0.1.9,
notes: added community page

version: 0.1.8,
notes: added Davinci•003

version: 0.1.7,
notes: upvote answers to bounties

version: 0.1.6,
notes: article editor refresh
)...
recent_tips: (
tipper: @AriseFacilitySolutions09,
tipped: article
amount: 1000 SATS,

tipper: @Yussuf4331,
tipped: article
amount: 1000 SATS,

tipper: @darkwebsites540,
tipped: article
amount: 10 SATS,
)...