Sorry, I tried to simplify things by using a date tag, but this has just 
caused confusion. I don't just need to replace a date tag, I need to replace a 
tag named logos, which I'd like to replace with a macro containing TAL code to 
insert a bunch of company logo's. I have now done it like this:

In home.xhtml

<tal:block metal:use-macro="main.xhtml/main">
    <tal:block metal:fill-slot="page">

        <h1 tal:content="page/GetContent/GetTitel"></h1>


Then I use the following PreFilter:

class HomePreFilter extends PHPTAL_PreFilter {
    function filter($src) {
        $content = [retrieve home page from db]
        $content = str_replace('[logos]', '<tal:block metal:use-
macro="logos.xhtml/logos" />', $content);
        return str_replace('[HOME]', $content, $src);

Which works fine. Is this the best way?

Bas Kooij

PHPTAL mailing list

Reply via email to