Forum OpenACS Q&A: Re: integrating i.e. blogger include into etp...

Collapse
Posted by Lars Pind on
David,

What I did for http://www.collaboraid.biz was to create an ETP  content type, which takes fully templated ADP code, and runs it through the templating system.

Then I have this in ETP on the http://www.collaboraid.biz/developer/ page:

<div style="float: right; width: 50%; border: 1px solid #cccccc; padding: 8px;">
<%=[lars_blog_get_as_string -url "/developer/blog"] %>
</div>

The only downside is that you have to be careful with what you put in those pages, since it will get interpreted, and thus may break.

Here's the code that handles it:

etp::get_page_attributes
foreach element { content } {
    if { [catch {
        set code [template::adp_compile -string $pa($element)]
        set pa($element) [template::adp_eval code]
    } errMsg] } {
        global errorInfo
        ns_log Error "$errMsg while evaluating ETP ADP page at [ad_return_url]: \n$errorInfo"
    }
}