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 4 of 4
  1. #1
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    One HTML file that i can edit to change data on multipule pages

    hello,

    Basically i want one HTML file that i can store my 'navigation' and 'header' lists in so that i can edit the one file and the changes effect the whole website.

    - This is so that i do not have to go through each page individually to add a new menu to the navigation.

    - i can do this in PHP, but i don't know how to do it in HTML.

    - I can not use PHP at this moment in time because my website is not stored on a server and i do not wish to store my website on a external server at this time nor do i have access or equipment to set up a local or home server at this time.

    Thank you very much.

  • #2
    Senior Coder
    Join Date
    Jan 2011
    Location
    Missouri
    Posts
    4,089
    Thanks
    23
    Thanked 593 Times in 592 Posts
    nor do i have access or equipment to set up a local or home server at this time.
    Huh? Have you looked into wamp?

    Have you tried iframes?
    Evolution - The non-random survival of random variants.

    "If you leave hydrogen alone, for long enough, it begins to think about itself."

  • #3
    New to the CF scene
    Join Date
    Apr 2013
    Posts
    1
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Try jQuery/JavaScript

    jQuery has this $('').load() that gets contents from an external html file. Unless you want to create an external JavaScript file as you mark.
    Page1.html
    <script src="source.js"></script>
    </head><body>
    <header id="head"></header>
    </body>
    </html>
    Page2.html

    <script src="source.js"></script>
    </head><body>
    <header id="head"></header>
    This is a second page.
    </body>
    </html>


    //source.js file
    document.getElementById("head").innerHTML="<h1>Babe!</h1>"

    You can use Iframes, but it is not recommended for headers...especially that is considered an external DOM for JavaScript, meaning, you need to specify the codes for the iframe source file away from your pages.

  • #4
    Senior Coder
    Join Date
    Aug 2010
    Location
    High Point, NC
    Posts
    3,335
    Thanks
    5
    Thanked 363 Times in 360 Posts
    As sunfighter said, you can set up a "testing" server to run php templates using WAMP or XAMP. These would be useful for creating, testing and running locally (on your machine) your server side templates.

    The process you're referring to is server side includes. You create a file that JUST contains your navigation, then include it into your "main" page. Same as with your header, footer or any other section of your page you want to break out.
    Teed


  •  

    Posting Permissions

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