Automating a Web Site Template

Collapse
X
 
  • Time
  • Show
Clear All
new posts
  • hsheboul
    New Member
    • May 2009
    • 14

    Automating a Web Site Template

    I'm working on a web site I'm almost done with designing the appearance using pure HTML and CSS, so I'm done as an HTML template.

    Most of the HTML code should be replicated into almost all my current pages and any newly created HTML page.

    To copy and paste the HTML for the entire HTML pages, in order to have the same menus, footer, etc., is a tedious and less efficient.

    What is the best way to replicate all the COMMON HTML code among all pages, using an automated or a programming way? (in order to be able to modify only one file instead of every file) Also this behavior would be impossible if some design has to change in the future.

    Is this doable using only Scripting languages, can I use Java, for instance?

    Please help. Thank you
  • Markus
    Recognized Expert Expert
    • Jun 2007
    • 6092

    #2
    Originally posted by hsheboul
    I'm working on a web site I'm almost done with designing the appearance using pure HTML and CSS, so I'm done as an HTML template.

    Most of the HTML code should be replicated into almost all my current pages and any newly created HTML page.

    To copy and paste the HTML for the entire HTML pages, in order to have the same menus, footer, etc., is a tedious and less efficient.

    What is the best way to replicate all the COMMON HTML code among all pages, using an automated or a programming way? (in order to be able to modify only one file instead of every file) Also this behavior would be impossible if some design has to change in the future.

    Is this doable using only Scripting languages, can I use Java, for instance?

    Please help. Thank you
    What server architecture are you running your site on? Apache? IIS? Do you have any server-side programming languages available on the site, e.g. PHP, ASP.NET, etc.?

    If you do not want to look into these options, then you might see if your hosting provider allows for server side includes (SSI).

    Comment

    • hsheboul
      New Member
      • May 2009
      • 14

      #3
      Originally posted by Markus
      If you do not want to look into these options, then you might see if your hosting provider allows for server side includes (SSI).
      Thanks Markus, you've been a great saver.

      My Web site is hosted on a Linux system, with Apache. But SSI is exactly what I needed; it was the best fit.

      The apache docs for ssi-howto and `mod include' were not enough, that I'm currently trying to automate small changes between some pages, e.g. for the menu that differs from one page into another, where the options are dependent on the *current* active page.

      Otherwise, all is well.

      Comment

      • Markus
        Recognized Expert Expert
        • Jun 2007
        • 6092

        #4
        Originally posted by hsheboul
        Thanks Markus, you've been a great saver.

        My Web site is hosted on a Linux system, with Apache. But SSI is exactly what I needed; it was the best fit.

        The apache docs for ssi-howto and `mod include' were not enough, that I'm currently trying to automate small changes between some pages, e.g. for the menu that differs from one page into another, where the options are dependent on the *current* active page.

        Otherwise, all is well.
        Hey, Hsheboul.

        The conditional SSI operators may be helpful to you. See the following example:

        Code:
        <!--#set var='page' value='$DOCUMENT_NAME' -->
        <!--#if expr='"${page}" = "page1.html"' -->
        	Display menu relative to page 1.
        <!--#elif expr='"${page}" = "page2.html"' -->
        	Display menu relative to page 2.
        <!-- ... -->
        <!--#else -->
        	Display a default menu.
        <!--#endif -->
        Do you see how you could display a menu based on the page now?

        Let me know if you need some more help,
        Mark.

        Comment

        • hsheboul
          New Member
          • May 2009
          • 14

          #5
          Thanks Markus for your quick reply. I was reading and experimenting through the SSI conditionals, and that requires some sort of "twedling" with the Apache server docs -- as some new stuff and different things that I was thinking before. For instance, the Linux environment variables need to be set/pass to the Apache.

          Comment

          Working...