+ Post New Thread
Page 1 of 2 12 LastLast
Results 1 to 15 of 21
Web Development Thread, Menu on everyweb page. in Coding and Web Development; I've found some nice navigation menu's, but the problem i cannot get my head around is how do have the ...
  1. #1
    Quackers's Avatar
    Join Date
    Jan 2006
    Posts
    1,276
    Thank Post
    39
    Thanked 134 Times in 110 Posts
    Rep Power
    51

    Menu on everyweb page.

    I've found some nice navigation menu's, but the problem i cannot get my head around is how do have the menu on everypage?
    Its a horazontal menu, so first i thought how about a frame,so the top of the page does not change. Then a problem comes that when the menu expands its covered up by the other frame. I cannot put the code in the body of everypage as when i update a link on the menu i would have to change it on every page on the whole site.

    How should i go about it?

  2. #2

    Join Date
    Nov 2005
    Location
    Middlesbrough
    Posts
    402
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Menu on everyweb page.

    You could use Server Side Includes or some easy PHP to just include some HTML in every page.

    The PHP method is very simple if your web server supports it, most should do!

    Change the extension of your page to .php and save the HTML that makes up your menu in a separate file (eg menu.txt).

    In the page where you would like the menu to appear insert the following:

    PHP Code:
    <? include_once("path/to/menu.txt"); ?>
    Upload your page and that should do it!

  3. #3

    Join Date
    Apr 2006
    Location
    UK
    Posts
    939
    Thank Post
    39
    Thanked 70 Times in 54 Posts
    Rep Power
    29

    Re: Menu on everyweb page.

    library element in dreamweaver works for me, add the menu to everypage and only have to edit one file - the library element, very similar to above php solution.

  4. #4

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,374
    Thank Post
    625
    Thanked 951 Times in 653 Posts
    Blog Entries
    2
    Rep Power
    318

    Re: Menu on everyweb page.

    If you don't have anything server-side that supports this you could use JavaScript. The only disadvantage are the people who disable javascript.

  5. #5

    Join Date
    Nov 2005
    Location
    North
    Posts
    1,731
    Thank Post
    23
    Thanked 78 Times in 63 Posts
    Rep Power
    35

    Re: Menu on everyweb page.

    I use this on my school website.

    http://www.milonic.com/

    You can use it for free or subscribe if you want. You just add code to each website and add a few files and away you go. Text file based admin too so its a piece of cake.

    If this is of no use then please ignore everything I have just said and pretend I wasn't here.

  6. #6
    Quackers's Avatar
    Join Date
    Jan 2006
    Posts
    1,276
    Thank Post
    39
    Thanked 134 Times in 110 Posts
    Rep Power
    51

    Re: Menu on everyweb page.

    Quote Originally Posted by indie
    You could use Server Side Includes or some easy PHP to just include some HTML in every page.

    The PHP method is very simple if your web server supports it, most should do!

    Change the extension of your page to .php and save the HTML that makes up your menu in a separate file (eg menu.txt).

    In the page where you would like the menu to appear insert the following:

    PHP Code:
    <? include_once("path/to/menu.txt"); ?>
    Upload your page and that should do it!
    So lets say i'm using IIS6. All the <body> menu stuff save as .txt instead of a .htm file, then at the start of every web page i make put
    PHP Code:
    <? include_once("path/to/menu.txt"); ?>
    and save as .php instead of .htm? Simple as that? I do not have to turn some settings on IIS on to allow PHP or somthing?

  7. #7

    Join Date
    Nov 2005
    Location
    Middlesbrough
    Posts
    402
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Menu on everyweb page.

    Ahh, you'll have to install PHP and set IIS up to use it, fairly simple though, have a look here.

    Your <BODY> tag should stay in your main page, just put the HTML that actually makes up your menu into the includes file.

    Depends on where you want your menu to appear, if you literally want it to be at the top of a page then yeah add the "<? include_once("path/to/menu.txt"); ?>" below your first <BODY> tag, if not add it inside whichever tag you want to place it by.

    For example, I've added a menu inside a cell in a table so i've used the following code:

    Code:
    <td width="10" background="furniture/greybar.gif"></td>
        <td width="150" background="furniture/greybar.gif">
        
          <? include_once("includes/indexleftlinks.txt"); ?>
    	
        </td>
    Remember to actually change "path/to/menu.txt" to whatever file you're including!

  8. #8

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,374
    Thank Post
    625
    Thanked 951 Times in 653 Posts
    Blog Entries
    2
    Rep Power
    318

    Re: Menu on everyweb page.

    If you're using IIS you will have ASP (Active Server Pages) functionality which will allow includes. Name your pages with the .asp extension.

    To run ASP includes, you simply need to do this:

    page.html:
    Code:
    <html>
    <head>
    ...
    </head>
    <body>
    
    
    
    This is a web page. The menu should be above.</p>
    </body>
    </html>
    The important bit is the #include section.

  9. #9

    Join Date
    Nov 2005
    Location
    Middlesbrough
    Posts
    402
    Thank Post
    0
    Thanked 0 Times in 0 Posts
    Rep Power
    0

    Re: Menu on everyweb page.

    Good point webman, didn't think about that, can you tell i'm an Apache bastard? :P

  10. #10
    Netman's Avatar
    Join Date
    Jul 2005
    Location
    56.343515, -2.804118
    Posts
    911
    Thank Post
    367
    Thanked 190 Times in 143 Posts
    Rep Power
    53

    Re: Menu on everyweb page.

    If you're using dreamweaver you can use a template to accomplish this - add the menu to the template, apply the template to every page.. you only have to update the template menu and then reapply it to the pages when you need to make changes...
    NVU also has a template function that looks similar to dw although I havn't used it myself yet....

  11. #11
    Quackers's Avatar
    Join Date
    Jan 2006
    Posts
    1,276
    Thank Post
    39
    Thanked 134 Times in 110 Posts
    Rep Power
    51

    Re: Menu on everyweb page.

    Got it working now thanks, now i can spend the rest of the day locked in my office with dreamweaver.

  12. #12
    Quackers's Avatar
    Join Date
    Jan 2006
    Posts
    1,276
    Thank Post
    39
    Thanked 134 Times in 110 Posts
    Rep Power
    51

    Re: Menu on everyweb page.

    Does this ASP thing make a meal out of style sheets? I have my menu.htm and my default.asp. Load either one (both have the same style sheet in use) and it looks as it should correct font sizes.

    Merge them using the ASP thing and certain fonts go bold or bigger text. I do not understand why, as they are both using the same .css file! I've tried just have the menu.htm with a style sheet, just default.asp with a style sheet. Nothing seems to fix it.

    As soon as i pop this code in the default.asp

    <html>
    <head>
    </head>
    <body>













    </body>
    </html>

    both pages are in the right position, just not the right font sizes!

  13. #13

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,374
    Thank Post
    625
    Thanked 951 Times in 653 Posts
    Blog Entries
    2
    Rep Power
    318

    Re: Menu on everyweb page.

    Are you able to post links to these two files at all or upload them to the thread as .txt files?

  14. #14
    Quackers's Avatar
    Join Date
    Jan 2006
    Posts
    1,276
    Thank Post
    39
    Thanked 134 Times in 110 Posts
    Rep Power
    51

    Re: Menu on everyweb page.

    http://www.chesterton-high.net/new/default.asp is the "merged" page.

    http://www.chesterton-high.net/new/menu.htm is the menu page by its self.

    http://www.chesterton-high.net/new/defaultown.asp is identical to default.asp but without the first few lines of code out telling it to load menu.htm

    If you load menu.htm or defaultown.asp they load as i want. Load the "merged" copy and some of the menu fonts go bigger and stuff.

    I'm only playing with it at the moment, but i'm not going any further content wise until i can stop it changing the font!

  15. #15

    webman's Avatar
    Join Date
    Nov 2005
    Location
    North East England
    Posts
    8,374
    Thank Post
    625
    Thanked 951 Times in 653 Posts
    Blog Entries
    2
    Rep Power
    318

    Re: Menu on everyweb page.

    That would be because the menu page includes the HTML tags, and then so does the main page so are conflicting.

    As the menu is included in each page, it does not need the HTML tags for head, body, title, style etc - just the DIVs for the menu.

SHARE:
+ Post New Thread
Page 1 of 2 12 LastLast

Similar Threads

  1. Create menu & sub-menu with Edugeek Joomla
    By FN-GM in forum EduGeek Joomla 1.0 Package
    Replies: 24
    Last Post: 8th December 2007, 11:48 PM
  2. menu
    By russdev in forum General EduGeek News/Announcements
    Replies: 0
    Last Post: 16th April 2006, 06:00 PM

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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