integrating/calling multiple files into one

Discussion in 'HTML' started by Daniel, Nov 1, 2007.

  1. Daniel

    Daniel Guest

    Hello,

    Typically, I have create simple html webpages from start to finish,
    everything in one html document.

    I am now creating more complexe pages, and wish to compartmentalize
    certain aspects. For example, the nav bar get generated by a separate
    program which generate and html file, css, js.... I then call it
    within my main doc. However, by doing so I end up with duplication of
    head section, body.... and I assume this is not proper. The other
    alternative is to copy and paste the various element of the nav bar
    (styles, scripts, html) and the paste them in their respective zones.
    this however, is very conterproductive as when a change need to be
    made I must manually update each webpage (long and prone to errors).

    What is the proper approach to doing this type of referencing multiple
    docs into one.

    Thank you for your experience and guidance,

    Daniel
     
    Daniel, Nov 1, 2007
    #1
    1. Advertising

  2. Daniel

    Bone Ur Guest

    Well bust mah britches and call me cheeky, on Thu, 01 Nov 2007 20:19:15 GMT
    Daniel scribed:

    > Hello,
    >
    > Typically, I have create simple html webpages from start to finish,
    > everything in one html document.
    >
    > I am now creating more complexe pages, and wish to compartmentalize
    > certain aspects. For example, the nav bar get generated by a separate
    > program which generate and html file, css, js.... I then call it
    > within my main doc. However, by doing so I end up with duplication of
    > head section, body.... and I assume this is not proper. The other
    > alternative is to copy and paste the various element of the nav bar
    > (styles, scripts, html) and the paste them in their respective zones.
    > this however, is very conterproductive as when a change need to be
    > made I must manually update each webpage (long and prone to errors).
    >
    > What is the proper approach to doing this type of referencing multiple
    > docs into one.
    >
    > Thank you for your experience and guidance,


    The best thing to do is use server-side scripting such as php. SSIs are
    also an option. Scripting allows you to variablize and include sections of
    text, html, etc.

    --
    Bone Ur
    Cavemen have formidable pheromones.
     
    Bone Ur, Nov 1, 2007
    #2
    1. Advertising

  3. Daniel

    Daniel Guest

    On Nov 1, 4:51 pm, Bone Ur <> wrote:
    > Well bust mah britches and call me cheeky, on Thu, 01 Nov 2007 20:19:15 GMT
    > Daniel scribed:
    >
    >
    >
    >
    >
    > > Hello,

    >
    > > Typically, I have create simple html webpages from start to finish,
    > > everything in one html document.

    >
    > > I am now creating more complexe pages, and wish to compartmentalize
    > > certain aspects. For example, the nav bar get generated by a separate
    > > program which generate and html file, css, js.... I then call it
    > > within my main doc. However, by doing so I end up with duplication of
    > > head section, body.... and I assume this is not proper. The other
    > > alternative is to copy and paste the various element of the nav bar
    > > (styles, scripts, html) and the paste them in their respective zones.
    > > this however, is very conterproductive as when a change need to be
    > > made I must manually update each webpage (long and prone to errors).

    >
    > > What is the proper approach to doing this type of referencing multiple
    > > docs into one.

    >
    > > Thank you for your experience and guidance,

    >
    > The best thing to do is use server-side scripting such as php. SSIs are
    > also an option. Scripting allows you to variablize and include sections of
    > text, html, etc.
    >
    > --
    > Bone Ur
    > Cavemen have formidable pheromones.- Hide quoted text -
    >
    > - Show quoted text -


    So, you are saying i should split the navbar.html into section
    (header, html,...) and call them individually at the right place?
     
    Daniel, Nov 1, 2007
    #3
  4. Daniel wrote:
    > Hello,
    >
    > Typically, I have create simple html webpages from start to finish,
    > everything in one html document.
    >
    > I am now creating more complexe pages, and wish to compartmentalize
    > certain aspects. For example, the nav bar get generated by a separate
    > program which generate and html file, css, js.... I then call it
    > within my main doc. However, by doing so I end up with duplication of
    > head section, body.... and I assume this is not proper. The other
    > alternative is to copy and paste the various element of the nav bar
    > (styles, scripts, html) and the paste them in their respective zones.
    > this however, is very conterproductive as when a change need to be
    > made I must manually update each webpage (long and prone to errors).
    >
    > What is the proper approach to doing this type of referencing multiple
    > docs into one.
    >
    > Thank you for your experience and guidance,


    Google is your friend:


    http://www.google.com/search?hl=en&...html document into another&btnG=Google Search
    how to include one html document into another - Google Search

    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Nov 1, 2007
    #4
  5. Daniel

    Daniel Guest

    On Nov 1, 5:00 pm, "Jonathan N. Little" <> wrote:
    > Daniel wrote:
    > > Hello,

    >
    > > Typically, I have create simple html webpages from start to finish,
    > > everything in one html document.

    >
    > > I am now creating more complexe pages, and wish to compartmentalize
    > > certain aspects. For example, the nav bar get generated by a separate
    > > program which generate and html file, css, js.... I then call it
    > > within my main doc. However, by doing so I end up with duplication of
    > > head section, body.... and I assume this is not proper. The other
    > > alternative is to copy and paste the various element of the nav bar
    > > (styles, scripts, html) and the paste them in their respective zones.
    > > this however, is very conterproductive as when a change need to be
    > > made I must manually update each webpage (long and prone to errors).

    >
    > > What is the proper approach to doing this type of referencing multiple
    > > docs into one.

    >
    > > Thank you for your experience and guidance,

    >
    > Google is your friend:
    >
    > http://www.google.com/search?hl=en&q=how to include one html document...
    > how to include one html document into another - Google Search
    >
    > --
    > Take care,
    >
    > Jonathan
    > -------------------
    > LITTLE WORKS STUDIOhttp://www.LittleWorksStudio.com- Hide quoted text -
    >
    > - Show quoted text -


    I understand the basics of including the file. My issue is that the
    file in question is a html file on it's own (styles, header info,
    script and html) if I include it at the appropriate place in the main
    page I double up on these sections. So I end up with a 2nd header
    within the body of my main page, etc.

    If it were merely html coding (tables, text....) then no problem a
    simple include work great but in this case i was wondering if I was
    missing an obvious tip/trick that professional use.

    Thank you for your reply! I am going through google in more detail.
     
    Daniel, Nov 1, 2007
    #5
  6. Daniel wrote:
    > On Nov 1, 5:00 pm, "Jonathan N. Little" <> wrote:
    >> Daniel wrote:
    >>> Hello,
    >>> Typically, I have create simple html webpages from start to finish,
    >>> everything in one html document.
    >>> I am now creating more complexe pages, and wish to compartmentalize
    >>> certain aspects. For example, the nav bar get generated by a separate
    >>> program which generate and html file, css, js.... I then call it
    >>> within my main doc. However, by doing so I end up with duplication of
    >>> head section, body.... and I assume this is not proper. The other
    >>> alternative is to copy and paste the various element of the nav bar
    >>> (styles, scripts, html) and the paste them in their respective zones.
    >>> this however, is very conterproductive as when a change need to be
    >>> made I must manually update each webpage (long and prone to errors).
    >>> What is the proper approach to doing this type of referencing multiple
    >>> docs into one.
    >>> Thank you for your experience and guidance,

    >> Google is your friend:
    >>
    >> http://www.google.com/search?hl=en&q=how to include one html document...
    >> how to include one html document into another - Google Search


    > I understand the basics of including the file. My issue is that the
    > file in question is a html file on it's own (styles, header info,
    > script and html) if I include it at the appropriate place in the main
    > page I double up on these sections. So I end up with a 2nd header
    > within the body of my main page, etc.
    >
    > If it were merely html coding (tables, text....) then no problem a
    > simple include work great but in this case i was wondering if I was
    > missing an obvious tip/trick that professional use.
    >
    > Thank you for your reply! I am going through google in more detail.
    >


    If you do Google and read about includes, be they SSI, PHP or other
    server-side scripting, your will learn that the parts to be included,
    are just that parts. Only put the markup for the part that is to be
    inserted, i.e., for a navbar included there would only be a UL of links
    with not HTML HEAD BODY on other elements...



    <!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01//EN"
    "http://www.w3.org/TR/html4/strict.dtd">
    <html>
    <head>
    <meta http-equiv="content-type" content="text/html; charset=iso-8859-1">
    <meta http-equiv="content-language" content="en-us">
    <title>Sample Page</title>
    </head>
    <body>

    <?php include_once('/common/header.php'); ?>

    <h1>A Sample PHP Include Page</h1>

    <?php include_once('/common/navbar.php'); ?>

    <p>
    The rest of your page...
    </p>

    <?php include_once('/common/footer.php'); ?>

    </body>
    </html>



    --
    Take care,

    Jonathan
    -------------------
    LITTLE WORKS STUDIO
    http://www.LittleWorksStudio.com
     
    Jonathan N. Little, Nov 1, 2007
    #6
  7. Daniel

    Els Guest

    Daniel wrote:
    > On Nov 1, 5:00 pm, "Jonathan N. Little" <> wrote:
    >> Daniel wrote:


    >>> I am now creating more complexe pages, and wish to compartmentalize
    >>> certain aspects. For example, the nav bar get generated by a separate
    >>> program which generate and html file, css, js.... I then call it
    >>> within my main doc. However, by doing so I end up with duplication of
    >>> head section, body.... and I assume this is not proper. The other
    >>> alternative is to copy and paste the various element of the nav bar
    >>> (styles, scripts, html) and the paste them in their respective zones.
    >>> this however, is very conterproductive as when a change need to be
    >>> made I must manually update each webpage (long and prone to errors).


    >> http://www.google.com/search?hl=en&q=how to include one html document...
    >> how to include one html document into another - Google Search


    > I understand the basics of including the file. My issue is that the
    > file in question is a html file on it's own (styles, header info,
    > script and html) if I include it at the appropriate place in the main
    > page I double up on these sections. So I end up with a 2nd header
    > within the body of my main page, etc.


    You're saying the 'file in question', navbar.html, is generated. Can't
    you generate separate files? Or, instead of splitting it up and
    pasting it their respective zones, just split it up once, into
    different files. Those files you can then include through SSI or php
    includes. A change then only has to be made once to this set of files
    (formerly one navbar.html file).

    > If it were merely html coding (tables, text....) then no problem a
    > simple include work great but in this case i was wondering if I was
    > missing an obvious tip/trick that professional use.


    If you give more info on the generation of this navbar.html file,
    maybe someone will see a better way to get the result you're after.

    --
    Els http://locusmeus.com/
     
    Els, Nov 1, 2007
    #7
  8. Daniel

    Bone Ur Guest

    Well bust mah britches and call me cheeky, on Thu, 01 Nov 2007 20:59:31
    GMT Daniel scribed:

    >> > What is the proper approach to doing this type of referencing
    >> > multiple docs into one.

    >>
    >> > Thank you for your experience and guidance,

    >>
    >> The best thing to do is use server-side scripting such as php. SSIs
    >> are also an option. Scripting allows you to variablize and include
    >> sections of text, html, etc.
    >>
    >> --
    >> Bone Ur
    >> Cavemen have formidable pheromones.- Hide quoted text -
    >>
    >> - Show quoted text -

    >
    > So, you are saying i should split the navbar.html into section
    > (header, html,...) and call them individually at the right place?


    Well, I haven't seen your work, but that's probably what I'd do. When I
    use includes (seldom), it's usually just data - no styles. I find it
    easier to locate styles all in one place and manipulate the pieces of data
    and html as I wish without worrying about adjuncts.

    --
    Bone Ur
    Cavemen have formidable pheromones.
     
    Bone Ur, Nov 1, 2007
    #8
  9. Daniel

    Daniel Guest

    On Nov 1, 7:32 pm, Bone Ur <> wrote:
    > Well bust mah britches and call me cheeky, on Thu, 01 Nov 2007 20:59:31
    > GMT Daniel scribed:
    >
    >
    >
    >
    >
    > >> > What is the proper approach to doing this type of referencing
    > >> > multiple docs into one.

    >
    > >> > Thank you for your experience and guidance,

    >
    > >> The best thing to do is use server-side scripting such as php. SSIs
    > >> are also an option. Scripting allows you to variablize and include
    > >> sections of text, html, etc.

    >
    > >> --
    > >> Bone Ur
    > >> Cavemen have formidable pheromones.- Hide quoted text -

    >
    > >> - Show quoted text -

    >
    > > So, you are saying i should split the navbar.html into section
    > > (header, html,...) and call them individually at the right place?

    >
    > Well, I haven't seen your work, but that's probably what I'd do. When I
    > use includes (seldom), it's usually just data - no styles. I find it
    > easier to locate styles all in one place and manipulate the pieces of data
    > and html as I wish without worrying about adjuncts.
    >
    > --
    > Bone Ur
    > Cavemen have formidable pheromones.- Hide quoted text -
    >
    > - Show quoted text -


    Thank you all for your time and advice!

    Daniel - Learning all the time
     
    Daniel, Nov 2, 2007
    #9
    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. Webdiyer
    Replies:
    0
    Views:
    712
    Webdiyer
    Nov 18, 2003
  2. =?Utf-8?B?TmV4dXM=?=

    Integrating Flash actionscript into ASP .Net apps ???

    =?Utf-8?B?TmV4dXM=?=, Apr 20, 2004, in forum: ASP .Net
    Replies:
    1
    Views:
    430
    bruce barker
    Apr 20, 2004
  3. Shikari Shambu
    Replies:
    7
    Views:
    3,226
    rajkrishna_net
    Oct 6, 2006
  4. George Durzi
    Replies:
    2
    Views:
    348
    George Durzi
    Nov 1, 2004
  5. Replies:
    4
    Views:
    957
    M.E.Farmer
    Feb 13, 2005
Loading...

Share This Page