I have a number of CGI scripts I need to get within my new website template. Some of them have header/footer files and some do not.

Normally this would be an easy task but as it is, my site has 6 separate SSIs for each page (the main page, header, footer, table1, table2, etc). How can I get my scripts to working within my layout if I have so many server side included files per page?

My first idea was to drop the 6 SSI's and make them into just 2 somehow and use them normally as a header/footer for the CGI scripts. I really don't think having to create tons of different templates with different included files is the route I want to take.

The only other idea I had would be to use LWP::Simple to open my site like a browser would see it (a full page with all the SSI content already nested inside) and then break it apart into 2 files (a header and a footer file). This would work on the fly and would change as often as the script is loaded and I would never have to create more server side includes to make it work. I would have to find a way to include an HTML comment for the script to separe the header and the footer from.

Right now, I think the last idea would be the best. I'm not even sure if it's possible, so any suggestions or ideas you can offer would be much appreciated.

Thanks.


In reply to CGI within your layout by Anonymous Monk

Title:
Use:  <p> text here (a paragraph) </p>
and:  <code> code here </code>
to format your post, it's "PerlMonks-approved HTML":



  • Posts are HTML formatted. Put <p> </p> tags around your paragraphs. Put <code> </code> tags around your code and data!
  • Titles consisting of a single word are discouraged, and in most cases are disallowed outright.
  • Read Where should I post X? if you're not absolutely sure you're posting in the right place.
  • Please read these before you post! —
  • Posts may use any of the Perl Monks Approved HTML tags:
    a, abbr, b, big, blockquote, br, caption, center, col, colgroup, dd, del, details, div, dl, dt, em, font, h1, h2, h3, h4, h5, h6, hr, i, ins, li, ol, p, pre, readmore, small, span, spoiler, strike, strong, sub, summary, sup, table, tbody, td, tfoot, th, thead, tr, tt, u, ul, wbr
  • You may need to use entities for some characters, as follows. (Exception: Within code tags, you can put the characters literally.)
            For:     Use:
    & &amp;
    < &lt;
    > &gt;
    [ &#91;
    ] &#93;
  • Link using PerlMonks shortcuts! What shortcuts can I use for linking?
  • See Writeup Formatting Tips and other pages linked from there for more info.