One menu file for all the pages in your site

Discussion in 'HTML & Website Design' started by ahelpinghand, Mar 1, 2007.

  1. #1
    I need to make one menu file for all page so when I need to add or delete and item, I don't have to change all pages on my site. What do you think is the best idea?

    if I use server side include (like php include), first php should be installed on the server and the menu doesn't "know" what page is displayed now so I can't disable the current page link menu item link or change the color.

    Some people use java script to do the same idea but user should have java script enabled to see the menu and I doubt this is earch engine friendly too.

    Some people use frames but I hate it and I know most of you do too for many reasons. :)

    What is the methode you use to acomplish that?
     
    If someone posts a solution, use the "Best Answer" link in their post to pick it as the best answer.
    ahelpinghand, Mar 1, 2007 IP
  2. rgchris

    rgchris Peon

    Messages:
    187
    Likes Received:
    2
    Best Answers:
    0
    Trophy Points:
    0
    #2
    PHP is able to know what page it's displaying, you just need to do a bit more coding. Look on php.net for server variables.
     
    rgchris, Mar 1, 2007 Set Best Answer IP
  3. libertygone

    libertygone Active Member

    Messages:
    2,625
    Likes Received:
    48
    Best Answers:
    0
    Trophy Points:
    90
    #3
    you'll be needing PHP for this.. im not sure there is a way to do it with html other than frames... :confused:
     
  4. ahelpinghand

    ahelpinghand Guest

    Best Answers:
    0
    #4
    The worst thing about the php solution is that I have to rename all my pages to .php and update all the links :(. I have heard about editing .htacess with "ddType application/x-httpd-php .htm .html" but unfortunately my host doesn't let me edit .htaces file.

    Do you suggest another design where I don't include menu in all pages?
     
  5. kk5st

    kk5st Prominent Member

    Messages:
    3,497
    Likes Received:
    376
    Best Answers:
    29
    Trophy Points:
    335
    #5
    Use html server side includes. Use the x-bit hack, and you won't have to change file names, only do a chmod +x *.html. This assumes Apache or other standards compliant server. IIS is an unknown for me. :shrug:

    cheers,

    gary
     
    kk5st, Mar 1, 2007 Set Best Answer IP
  6. ahelpinghand

    ahelpinghand Guest

    Best Answers:
    0
    #6
    Do you know any free utility -or ideas- to change all the links in your site from .html to .php? Because with normal text editors you have to open the pages one by one and they would change the extension inside the page text too.
     
  7. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #7
    There's no need to change page names, and I don't recomment it.
    You'll lose your indexed pages on search engines and your PR.
    You should make a "virtual file renaming" with RewriteRule on your .htaccess file.
     
    ajsa52, Mar 2, 2007 Set Best Answer IP
  8. eski009

    eski009 Peon

    Messages:
    48
    Likes Received:
    0
    Best Answers:
    0
    Trophy Points:
    0
    #8
    you don't need to lose your pagerank - simply 301 redirect all your old pages to your new ones and you keep your google ranking.

    Quite easy to do - just Google it!
     
    eski009, Mar 2, 2007 Set Best Answer IP
  9. ahelpinghand

    ahelpinghand Guest

    Best Answers:
    0
    #9
    Page rank is not a problem because my site is almost new :)
    So other than page rank, do you recommend changing the files extension to php for all my site or it's better to stay .html?
     
  10. ajsa52

    ajsa52 Well-Known Member

    Messages:
    3,426
    Likes Received:
    125
    Best Answers:
    0
    Trophy Points:
    160
    #10
    IMO is better to have .html extension.
    Some bots are not getting/indexing pages when there are too many parameters in URL.
    You can "insert" those parameters in .html page with "mod rewrite" feature on your .htaccess.
    Example:
    yourSite.com/page1.php?par1=val1&par2=val2
    yourSite.com/page1/par1-val1,par2-val2.html, of whatever syntax you like
    .
     
    ajsa52, Mar 2, 2007 Set Best Answer IP