Results 1 to 4 of 4

Thread: How to modularize CSS menus

  1. #1
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default How to modularize CSS menus

    Here's a noob question to be sure: how do I modularize CSS menus? In other words, I want to define a menu (e.g., SuckerTree Horizontal Menu) once, and then call/invoke it from any number of pages. Is this possible, or must I duplicate the HTML code in every page? Seems to me that last method would be inefficient, since a change to the menu would require a change to each and every page. All suggestions gratefully accepted, WyrdForge.

  2. #2
    Join Date
    Nov 2007
    Location
    USA
    Posts
    170
    Thanks
    8
    Thanked 22 Times in 22 Posts

    Default

    The only way I could think to do this would be to create your menu in a .htm/.html file, then wherever you want it to be just use PHP to include it:

    Code:
     
    
    <?php include("menu.htm"); ?>
    That will insert it into any page you have the include in and whenever you need to modify the menu you will only have to edit the one file.

    Hope this helped.

  3. #3
    Join Date
    Oct 2008
    Posts
    2
    Thanks
    0
    Thanked 0 Times in 0 Posts

    Default

    Thanks for your reply. I should have also mentioned that the web site I'm redesigning is hosted on a zero-cost basis, and therefore provides absolutely no server-side services. I'm limited to client-side includes, JavaScript, and others I can only guess at.

  4. #4
    Join Date
    Nov 2007
    Location
    USA
    Posts
    170
    Thanks
    8
    Thanked 22 Times in 22 Posts

    Default

    Oh I see. I'm not sure if there is a way for you do it then. Unless maybe you make a JavaScript Menu or some kind of Dynamic DHTML Menu or something... that might work. Not to sure though

Bookmarks

Posting Permissions

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