Please help make an embeded navigation header in all my pages

Discussion in 'HTML & Website Design' started by Anthony Girdler, Feb 28, 2013.

  1. #1
    Hi,
    I am trying to make a navigation panel to use on all of my pages. Such that if I make a change to the navigation panel it changes on every page.
    Initially I made a nice, simple table with some rollover buttons and a picture and embeded it on each page with an iframe. Very simple.
    Then I got ambitious and messed it up.
    I made the navigation panel using a horizontal menu bar with some sub menu drop downs.
    This ruins my iframe because the dropdowns don't fit and the iframe has an ugly scroll bar on the side.
    I want to get ride of the side scroll bar in the iframe and have the drop downs appear on top of other content.

    I have attached a sketch of what I want it too look like.
    Please help.
    Thanks in advance.
    website sketch.jpg
     
    Solved! View solution.
    Last edited: Feb 28, 2013
    Anthony Girdler, Feb 28, 2013 IP
  2. #2
    You could use PHP include statement

    Insert this code in all pages,
    <?php include 'navigation.php'; ?>
    Code (php):
    And place the navigation panel code in a page called "navigation.php"
    The above code only works if your document extention is PHP, for HTML extention you need to add this code into .htaccess or php.ini

    AddType application/x-httpd-php .html

    And insert this code in all pages:
    <?php include ('navigation.inc');?>
    Code (php):
    And place the navigation panel code in a page called "navigation.inc"
     
    Masim man, Feb 28, 2013 IP
  3. Anthony Girdler

    Anthony Girdler Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #3
    Thanks for the reply Masim.
    I do not understand what this means:
    ".......add this code into .htaccess or php.ini
    AddType application/x-httpd-php .html"

    So I tried making a new php page with dreamweaver as a trial.
    Here are the results.
    http://www.huntertennisacademy.com.au/navigation.php
    http://www.huntertennisacademy.com.au/
    It seems to be doing what I wanted. The drop down menus are ontop of the other content.
    Is this what you meant ?
    Have I placed the:
    1. <?php include 'navigation.php'; ?>
    in the correct place ?

    Small problem though, within dreamweaver, home page, I can't see the content in the design. It's as though the navigation.php is on top of it making it hidden from view. Not a major issue, but would be nice to be able to see what I am doing live in dreamweaver rather than have to upload to view each change.

    BTW, Is php similar to html ?
    Can I just save my html docs as php ? or should I start again ?

    Thanks again.
     
    Anthony Girdler, Feb 28, 2013 IP
  4. Masim man

    Masim man Active Member

    Messages:
    73
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    58
    #4
    It seems that you are using php extension, so you don't need to add "AddType application/x-httpd-php .html" into .htaccess or httpd.conf (sorry not php.ini)

    You placed the code in the right place but you only need to insert the table and the script elements in the navigation.php not the complete html page.

    I don't recommended to use Dreamweaver "Design View' to view your document, use real browsers instead.

    PHP creates a dynamic pages just like what you did and it need a server to be able to view php files in a browser, whereas HTML creates a static pages that we can view it in a browser directly.

    Yes, you can just save your html as php.
     
    Masim man, Feb 28, 2013 IP
  5. Anthony Girdler

    Anthony Girdler Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #5
    Thanks heaps Masim.
    Anything I can do to help you ?
    Does this forum use vote ups or similar ?
    Can I rate you as awesome ?
     
    Anthony Girdler, Feb 28, 2013 IP
  6. Masim man

    Masim man Active Member

    Messages:
    73
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    58
    #6
    No problem, glad I could help. :)

    One more advice though, try to avoid using table for layout, use it for tabular data only.
    There are lots of free CSS layouts (tableless) out there that you can download and learn them.

    Thanks for your Kindnesses.
     
    Masim man, Feb 28, 2013 IP
  7. Anthony Girdler

    Anthony Girdler Greenhorn

    Messages:
    4
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    21
    #7
    Hey Masim,
    Can you direct me to a CSS layout that would get me something that looks like my sketch ?
     
    Anthony Girdler, Mar 1, 2013 IP
  8. Masim man

    Masim man Active Member

    Messages:
    73
    Likes Received:
    4
    Best Answers:
    2
    Trophy Points:
    58
    #8
    Sorry Anthony Girdler, I can't give you the direct link, maybe you can search them with keyword "free css layouts" (with quotation marks).

    Good luck.
     
    Masim man, Mar 1, 2013 IP