[geeklog-devel] About the "internal" and Webservices APIs

Joe Mucchiello joe at ThrowingDice.com
Sat Aug 11 12:53:14 EDT 2007


At 11:26 AM 8/11/2007, Oliver Spiesshofer wrote:
>this is the header:
>
><table>
><tr><td>[image1]</td><td>text text text</td></tr>
></table>
>
>this is the content:
>
><table style="text-align:center">
><tr><td>[image2]</td><td>[image3]</td><td>[image4]</td></tr>
><tr><td colspan="3">text text text</td></tr>
>[ repeats ]
></table>

Couldn't this be easily done using the existing template code. Just 
add something like this to SP_renderArticle():

     if( !empty( $bodytext ))
     {
//...
     }

     if (!empty($_CONF['global_template'])) { // or however you want 
to find the template
        $T = new Template($_CONF['path_global_templates']);
        $T->set_file('data',$_CONF['global_template']);
        $T->set_var('intro_text',$intro_text);
        $T->set_var('body_text',$body_text);
         /// etc
        $templated_text = $T->finish($T->parse('output','data'));
    } else {
        $templated_text = $introtext . $bodytext;
   }


Then your normal template just includes {templated_text} where you 
want to show the templated version. Everything else is just interface.

----
Joe Mucchiello
Throwing Dice Games
http://www.throwingdice.com 




More information about the geeklog-devel mailing list