How to display the same links in every page?

F

fraternitydisposal

I'm making a personal site which contains links like home, resume,
feedback, hobbies, links in every page. And i've managed to create an
external css. How can i insert the said links in every page without
copying and pasting the links in every page?

My webhost doesn't support server side scripting. Can i store the links
in an external file and insert them by client side scripting? Please
help.
 
C

Chris F.A. Johnson

I'm making a personal site which contains links like home, resume,
feedback, hobbies, links in every page. And i've managed to create an
external css. How can i insert the said links in every page without
copying and pasting the links in every page?

My webhost doesn't support server side scripting.

Does it support server-side includes? Try a line like this in a
file with .shtml for its extension (e.g., index.shtml):

Can i store the links in an external file and insert them by client
side scripting? Please help.

An alternative is to have a link to a page of links.
 
F

fraternitydisposal

Infact I want to make a common navigation bar in every page which is
similar to :

Feedback
Resume
Hobbies
Research
Publications
Testimonials
etc

There won't be any dropdown menus. My webhost is worst of its kind. I
want to use javascript. Please help.
 
E

Ed Mullen

I'm making a personal site which contains links like home, resume,
feedback, hobbies, links in every page. And i've managed to create an
external css. How can i insert the said links in every page without
copying and pasting the links in every page?

My webhost doesn't support server side scripting. Can i store the links
in an external file and insert them by client side scripting? Please
help.

You could put the menu (links) in an external file and have it inserted
dynamically into each page via javascript. The pluses are that it
doesn't rely on server-side functions and you can change one file and
have it change every page on your site. The minus is that visitors must
have javascript enabled for your pages to work properly. You may well
see lots of negative comments in html and css newsgroups about
javascript. I personally find most of the concerns unfounded.

My site uses this technique. I have a header that is used on every
page. The content of the header is several buttons containing the menu
navigation system. All of the header info comes from the same file. To
change the menu on 200+ pages on my site I change just one or two files.

See Design Considerations at: http://edmullen.net/siteinfo.html

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Chastity is curable if detected early.
 
F

fraternitydisposal

Ed said:
You could put the menu (links) in an external file and have it inserted
dynamically into each page via javascript. The pluses are that it
doesn't rely on server-side functions and you can change one file and
have it change every page on your site. The minus is that visitors must
have javascript enabled for your pages to work properly. You may well
see lots of negative comments in html and css newsgroups about
javascript. I personally find most of the concerns unfounded.

My site uses this technique. I have a header that is used on every
page. The content of the header is several buttons containing the menu
navigation system. All of the header info comes from the same file. To
change the menu on 200+ pages on my site I change just one or two files.

See Design Considerations at: http://edmullen.net/siteinfo.html

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Chastity is curable if detected early.

This is what I'm looking for. But i'm failing to understand and modify
your javascript to fit my needs. I possible mention a good source to
learn javascript.
 
D

dorayme

I'm making a personal site which contains links like home, resume,
feedback, hobbies, links in every page. And i've managed to create an
external css. How can i insert the said links in every page without
copying and pasting the links in every page?

The obvious answer to the particular question is use Search and
Replace function in any decent text editor. No need to copy and
paste at all.
 
E

Ed Mullen

This is what I'm looking for. But i'm failing to understand and modify
your javascript to fit my needs. I possible mention a good source to
learn javascript.

Elsewhere you said you didn't need drop-down menus. So, all you need
from my method is to use

<script src="yourfile.js" type="text/javascript"></script>

in the <body> section of your page where you want the content to appear.

Then create a file (e.g., yourfile.js) and use the following to put the
content you want to appear on each page.

var writeExternalContent = '';
writeExternalContent += '<a href="link1.html">Link1</a>';
.... etc ...
document.writeln(writeExternalContent)

Here's a test case: http://edmullen.net/temp/t1.html
Here's the js file: http://edmullen.net/temp/yourfile.js

As to tutorials on javascript, I'd go to the bookstore and get a basic
book to start with.

--
Ed Mullen
http://edmullen.net
http://mozilla.edmullen.net
http://abington.edmullen.net
Error: Keyboard not attached. Press F1 to continue ...
 
A

Andrew

Infact I want to make a common navigation bar in every page which is
similar to :

Feedback
Resume
Hobbies
Research
Publications
Testimonials
etc

There won't be any dropdown menus. My webhost is worst of its kind. I
want to use javascript. Please help.

Hi Fraternity,

This can be done using Dreamweaver by setting the navigation bar as a
fixed area in a template. Useful for a really large site, (where
changes to the navigation bar in the template will then ripple out
across the entire site) but for a smaller site copy & paste might be
easier (and a lot cheaper).

All the best,

Andrew
 
J

Jukka K. Korpela

My webhost is worst of its kind. I
want to use javascript. Please help.

1) Change host.
2) Stop wanting to use javascript.

You're welcome.

P.S. Whatever you think you need, your visitors, if any, won't need a boring
set of navigational links on every page. Include just a link to the main
page, which contains links to the subpages.

(Alternatively, design the set of navigational links well, so that you won't
need to change it, and "manually" copy it to all subpages. This is trivial.
You have less than a dozen pages, right? Well, at the point of design where
people ask questions like yours, they usually haven't got a single content
page, and won't have one for quite some time, since they waste time with
irrelevant things like making navigation a problem and fine-tuning the
visual appearance down to the last pixel.)
 
D

David Dorward

Ed said:
The minus is that visitors must have javascript enabled for your pages to
work properly.

And those visitors include GoogleBot, which the majority of people seem to
care a great deal about.
 
H

harry.michaels

I'm making a personal site which contains links like home, resume,
feedback, hobbies, links in every page. And i've managed to create an
external css. How can i insert the said links in every page without
copying and pasting the links in every page?

My webhost doesn't support server side scripting. Can i store the links
in an external file and insert them by client side scripting? Please
help.

A safe option for you would be using iframes. Basically, you create an
external HTML file as you said, which only includes the links you want.
You can then insert the external page into your main page (and other
pages) using the following tag:

<iframe src="whatever.html" scrolling="no" frameborder="0" height=""
width=""></iframe>

Fill in the blanks and you're good to go. If you set scrolling to yes
and there is more content than can be displayed in the space you have
allocated, a scrollbar will be present. Frameborder removes the border
that appears by default. In regard to placement on the page etc., just
approach entering that code as you would with an image file. In terms
of occupying space on the page, it works the same way.

It's probably a good idea to have no page margins in the external HTML
file, if your CSS file doesn't handle that already. You can do this by
adjusting the <body> tag:

<body marginwidth="0" marginheight="0" leftmargin="0" topmargin="0">

....as well as the other usual stuff that goes in there.

Harry Michaels
 
D

dorayme

"Jukka K. Korpela said:
since they waste time with
irrelevant things like making navigation a problem and fine-tuning the
visual appearance down to the last pixel.

I am doing this at the moment with a new site.... I am absolutely
and utterly determined to iron out a few miserable little kinks
in a tab-look horizontal nav bar which I made from practically
first principles, reinventing the wheel in the dumbest possible
way, all my own work and my own kinks and it is truly a matter of
one pixel here and there at various text magnifications that I
spot are wrong...

The thing you may be underestimating, Mr Korpela, is this: it is
good sport. A sink for the wild impulses of the obsessive
personality. A fine distraction for when one is dog tired or
bored with more meaty work on the site and everyone at alt.html
is inconveniently asleep and therefore unavailable to entertain
and sharpen up the day in the sunny southern half of the planet
for visiting martians.
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,055
Latest member
SlimSparkKetoACVReview

Latest Threads

Top