Hello and welcome to our community! Is this your first visit?
Register
Enjoy an ad free experience by logging in. Not a member yet? Register.
Results 1 to 10 of 10
  1. #1
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts

    HOW-TO common parts of an HTML page

    Good friends,

    This is a question on fundamentals, not on details yet.

    The HTML pages in question are typical and simple in that they would consist, each, of:

    ---------------------------------------------------
    Top-Part (Code is same for all),

    Middle-Part (Code is DIFFERENT for each page), and

    Bottom-Part (Code is same for all).
    ----------------------------------------------------

    Is there a way (or more than one) to have only ONE Top-Part and only ONE Bottom-Part that is called by the page-in-question which would basically consist of the Middle-Part and calls to the Top and bottom parts?

    This means that a change in the Top-Part or in the Bottom-Part would reflect in as many HTML pages as used them right away, with no need to go and change any of the pages that call them.

    Thanks a lot.

    -mbl-

  • #2
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    use a server-side language such as PHP.
    Code:
    <!-- top content / body tag/ etc -->
    <?php switch / if / whatever which will lead to variable content ?>
    <!-- bottom content / footer-->

  • #3
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by fci
    use a server-side language such as PHP.
    Code:
    <!-- top content / body tag/ etc -->
    <?php switch / if / whatever which will lead to variable content ?>
    <!-- bottom content / footer-->
    Thanks, FCI.

    Am not at that level, though, unfortunately.

    Any other way? How about Frames (which still would need to study, and plan-to). Could frames load themselves with fixed data?

    Or something like layers (like photo-shop, concept only)?

    Thanks.

    -mbl-

  • #4
    Banned
    Join Date
    Sep 2003
    Posts
    3,620
    Thanks
    0
    Thanked 0 Times in 0 Posts
    This is not a javascript question and should be moved to the CSS/HTML forum... Please do not cross-post but rather contact a moderator and request that your post be moved to the correct forum....

    .....Willy

  • #5
    Senior Coder
    Join Date
    Jun 2002
    Location
    Wichita
    Posts
    3,880
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Use Server Side Includes (SSIs), contact your service provider to find the specifics for using SSIs (usually naming the pages *.shtml or similar).

    See: http://www.netmechanic.com/news/vol2/server_no8.htm
    Check out the Forum Search. It's the short path to getting great results from this forum.

  • #6
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by Willy Duitt
    This is not a javascript question and should be moved to the CSS/HTML forum... Please do not cross-post but rather contact a moderator and request that your post be moved to the correct forum....

    .....Willy
    Sorry, Willy.

    Being an ignorant, how can one know that there is or not a Javascript answer?

    Thanks.

    -mbl-

  • #7
    fci
    fci is offline
    Senior Coder
    Join Date
    Aug 2004
    Location
    Twin Cities
    Posts
    1,345
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by mbl
    Sorry, Willy.

    Being an ignorant, how can one know that there is or not a Javascript answer?

    Thanks.

    -mbl-
    I'd say this is a PHP queston. If you don't have access to PHP .. there is a way to do it in JS but I wouldn't recommend it.

  • #8
    Senior Coder joh6nn's Avatar
    Join Date
    Jun 2002
    Location
    72° W. 48' 57" , 41° N. 32' 04"
    Posts
    1,887
    Thanks
    0
    Thanked 1 Time in 1 Post
    Quote Originally Posted by fci
    I'd say this is a PHP queston. If you don't have access to PHP .. there is a way to do it in JS but I wouldn't recommend it.
    agreed; this is doable with javascript, but that should be a last resort; javscript wasn't intended for this use, and won't work nearly as well as a server side language. if you absolutely can't use a server side language, or can come up with a compelling reason why you need to do this with javascript, we'll help you do it, but otherwise, i'd like to move this to the Server Side forum.
    bluemood | devedge | devmo | MS Dev Library | WebMonkey | the Guide

    i am a loser geek, crazy with an evil streak,
    yes i do believe there is a violent thing inside of me.

  • #9
    Senior Coder
    Join Date
    Feb 2003
    Location
    Ontario, Canada
    Posts
    1,223
    Thanks
    0
    Thanked 0 Times in 0 Posts
    A better method would be to have the top and bottom page call the middle pages That way when you want to change your top and bottom more drastically, you won't have to touch every other page.

  • #10
    mbl
    mbl is offline
    New Coder
    Join Date
    Sep 2004
    Posts
    63
    Thanks
    0
    Thanked 0 Times in 0 Posts
    Quote Originally Posted by joh6nn
    agreed; this is doable with javascript, but that should be a last resort; javscript wasn't intended for this use, and won't work nearly as well as a server side language. if you absolutely can't use a server side language, or can come up with a compelling reason why you need to do this with javascript, we'll help you do it, but otherwise, i'd like to move this to the Server Side forum.
    Good friends,

    As said, it was not a question about details. Only a direction was being requested. It is irrelevant if moved, therefore, to where it may belong better.

    The direction is given, understood as very good, and appreciated as such.

    Thanks, every one.

    -mbl-


  •  

    Posting Permissions

    • You may not post new threads
    • You may not post replies
    • You may not post attachments
    • You may not edit your posts
    •