Monks,

I'm trying to think my way through a fairly interesting problem at the minute, and seem to be getting nowhere fast, so I thought I'd post here, and see if anyone has any suggestions.

I'm currently in the middle of writing some code for a community website, using CGI::Application and HTML::Template to serve up semi-dynamic content.

We'd like to implement a forum/bulletin board type system as part of this, integrating this into the current page design and layout (for consistency reasons). Rather than hand-rolling a solution, it seemed to make sense to use mature code, and we decided to use YaBB to handle the forum's back-end code, as it seems to do everything we're likely to need.

Integrating this with the current website should, in my mind, be a fairly simple task - I've made modifications to allow YaBB to share a common user database, and to detect login cookies from the main website. So far so good.

However, what I originally thought would be the easiest part of the integration is the bit that's causing me the most trouble: how best to include output from the YaBB script in the existing HTML templating? With static content, I'd simply use HTML::Template's include function, but with dynamic content, where calls are going to return to the YaBB script, rather than the main page CGI, this obviously isn't going to work - you end up with only the YaBB data being returned.

I've thought of replacing the YaBB.cgi script with one of my own, that can call the main page CGI with the YaBB arguments, handing over to YaBB to generate the forum content, then integrating all this into the existing templating, but this seems a large job for what seems, at first glance, a simple task.

YaBB can itself handle templating, but I'm loathe to reimplement templates that already exist for the main site, especially as it'd remove the generated/dynamic content from the main CGI.

Does anyone have any suggestions about how best to include the results from an external CGI in either HTML::Template's templating, or in some other method?

I should probably point out that I'm not doing this to pass YaBB off as my own work - its copyrights and required links will remain on all pages generated by the YaBB engine. This is purely for asthetic and consistency reasons across the site.

Any suggestions or comments would be welcomed.

Thanks in advance for your help.
-- Foxcub
A friend is someone who can see straight through you, yet still enjoy the view. (Anon)


In reply to Combining Results from Multiple CGIs into one HTML page by Tanalis

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.