How to display the same links in every page?

Discussion in 'HTML' started by fraternitydisposal@gmail.com, Aug 29, 2006.

  1. Guest

    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.
    , Aug 29, 2006
    #1
    1. Advertising

  2. On 2006-08-28, wrote:
    > 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):

    <!--#include virtual="links.html" -->

    > 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.


    --
    Chris F.A. Johnson <http://cfaj.freeshell.org>
    ===================================================================
    Author:
    Shell Scripting Recipes: A Problem-Solution Approach (2005, Apress)
    Chris F.A. Johnson, Aug 29, 2006
    #2
    1. Advertising

  3. Guest

    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.
    , Aug 29, 2006
    #3
  4. Ed Mullen Guest

    wrote:
    > 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.
    Ed Mullen, Aug 29, 2006
    #4
  5. John Guest

    John, Aug 29, 2006
    #5
  6. Guest

    Ed Mullen wrote:
    > wrote:
    > > 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.


    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.
    , Aug 29, 2006
    #6
  7. dorayme Guest

    In article
    <>,
    wrote:

    > 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.

    --
    dorayme
    dorayme, Aug 29, 2006
    #7
  8. Ed Mullen Guest

    wrote:
    > Ed Mullen wrote:
    >> wrote:
    >>> 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.

    >
    > 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 ...
    Ed Mullen, Aug 29, 2006
    #8
  9. Andrew Guest

    On 28 Aug 2006 16:46:26 -0700, wrote:

    >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
    --

    Andrew
    http://www.andrews-corner.org
    Andrew, Aug 29, 2006
    #9
  10. <> scripsit:

    > 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.)

    --
    Jukka K. Korpela ("Yucca")
    http://www.cs.tut.fi/~jkorpela/
    Jukka K. Korpela, Aug 29, 2006
    #10
  11. Ed Mullen wrote:

    > 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.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Aug 29, 2006
    #11
  12. wrote:

    > 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?


    Try a preprocessor.
    http://allmyfaqs.net/faq.pl?Include_one_file_in_another


    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Aug 29, 2006
    #12
  13. JDS Guest

    On Mon, 28 Aug 2006 16:03:22 -0700, fraternitydisposal wrote:

    > My webhost doesn't support server side scripting.


    Get a new host. Seriously. A dime a dozen, and you can get the features
    you want or need.

    --
    JDS
    JDS, Aug 29, 2006
    #13
  14. wrote:
    > 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
    harry.michaels, Aug 29, 2006
    #14
  15. harry.michaels wrote:

    > A safe option for you would be using iframes.


    I wouldn't call iframes "safe".
    http://allmyfaqs.net/faq.pl?Problems_with_using_frames

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


    Invalid, non-standard, not as well supported as stylesheets.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Aug 29, 2006
    #15
  16. dorayme Guest

    In article <dqQIg.81$>,
    "Jukka K. Korpela" <> wrote:

    > 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.

    --
    dorayme
    dorayme, Aug 29, 2006
    #16
  17. dorayme Guest

    In article <ed0ndg$gfq$2$>,
    David Dorward <> wrote:

    > wrote:
    >
    > > 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?

    >
    > Try a preprocessor.
    > http://allmyfaqs.net/faq.pl?Include_one_file_in_another


    Any Mac users out there using a preprocessor that they can
    recommend from personal experience on OS X?

    --
    dorayme
    dorayme, Aug 29, 2006
    #17
  18. dorayme wrote:
    > Any Mac users out there using a preprocessor that they can
    > recommend from personal experience on OS X?


    http://www.cs.tut.fi/~jkorpela/html/cpre.html describes using GCC for the
    purpose. It is available for OS X, it might even come with the OS.

    --
    David Dorward <http://blog.dorward.me.uk/> <http://dorward.me.uk/>
    Home is where the ~/.bashrc is
    David Dorward, Aug 29, 2006
    #18
  19. Ed Mullen Guest

    David Dorward wrote:
    > Ed Mullen wrote:
    >
    >> 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.
    >


    However, you can create an account and use Google's site maps to ensure
    that your site is properly indexed. Never been a problem here.

    --
    Ed Mullen
    http://edmullen.net
    http://mozilla.edmullen.net
    http://abington.edmullen.net
    The best audience is intelligent, well-educated, and a little drunk. -
    Alben W. Barkley (1877-1956)
    Ed Mullen, Aug 29, 2006
    #19
  20. In article <ed2d3h$kgk$1$>,
    David Dorward <> wrote:

    > http://www.cs.tut.fi/~jkorpela/html/cpre.html describes using GCC for the
    > purpose. It is available for OS X, it might even come with the OS.


    It does.

    leo

    --
    <http://web0.greatbasin.net/~leo/>
    Leonard Blaisdell, Aug 30, 2006
    #20
    1. Advertising

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

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. Shikari Shambu
    Replies:
    2
    Views:
    6,552
    Mark Fitzpatrick
    Aug 6, 2004
  2. Steven
    Replies:
    1
    Views:
    341
    Viator
    Mar 7, 2005
  3. Matt White

    Same Menu On Every Page

    Matt White, Aug 10, 2007, in forum: HTML
    Replies:
    8
    Views:
    995
    Bernhard Sturm
    Aug 11, 2007
  4. =?Utf-8?B?SXJ3YW5zeWFo?=
    Replies:
    4
    Views:
    2,426
    =?Utf-8?B?SXJ3YW5zeWFo?=
    Oct 30, 2007
  5. Garrett Smith
    Replies:
    14
    Views:
    288
    David Mark
    May 26, 2009
Loading...

Share This Page