logo       
Google Custom Search
    AddThis Social Bookmark Button
-->

Re: Passing a BLOCK to another template?: msg#00062

Subject: Re: Passing a BLOCK to another template?
Mark,

How do you declare a block in a top-level template, and make it available in
a subtemplate used as a wrapper?
In other words, I want to do something like this: --main.tt--
[% BLOCK mysidebar %]
sidebar stuff here
[% END %]

AFAIK, outside of main.tt, the mysidebar block is known as main.tt/mysidebar (at least that's the way I've had to handle it in my own experience).

 ...
[% WRAPPER bigtable.tt   sidebar=mysidebar %]
content
[% END %]
--bigtable.tt--
<table>
<tr>
<td>foo</td>
[% IF sidebar %]<td>[% sidebar %]</td>[% END %]

The problem there is that it's going to expand to "mysidebar" instead of calling the mysidebar block, right? You need (I think)

        [% PROCESS main.tt/$sidebar %]

or possibly

        [% PROCESS "main.tt/$sidebar" %]

I think that should do it.  HTH.


                -- Buddy


<Prev in Thread] Current Thread [Next in Thread>