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

Posted by Lars Pind on

What I did for 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 page:

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

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:

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"