including other templates

Tim Arnold <[email protected]> Fri, 4 Mar 2016 10:38:23 -0500
Newsgroups gmane.comp.python.cheetah
Message-ID <CA+O6OTD95jUybxSEcLbM8MHmXSOxf=4KuWF53VZoV+QpsJYtzA@mail.gmail.com>
--===============0455978545342175359==
Content-Type: multipart/alternative; boundary=047d7ba979d6cf5f0a052d3ae7e3

--047d7ba979d6cf5f0a052d3ae7e3
Content-Type: text/plain; charset=UTF-8

hi, I have several templates that contain some logic at the top; that logic
queries the searchList. I would like to put the logic into another template
so I can keep one copy of it and call it when I need it.

The problem I have is that if I call it with #include, I get an error on
$varExists, presumably because the searchList isn't yet available.

Has anyone accomplished this? Here's a pseudo example:
--called template--
set global procs = set()
#if $varExists('include')
  #set global $procs = set({!include})
#end if

--calling template--
#include 'called-template.tmpl'
#if $procs
   etc etc

I want the called-template to be input into the calling template and then
the whole thing processed.

I have tried '#include raw' but then the variable is unknown.

thanks,
--Tim

--047d7ba979d6cf5f0a052d3ae7e3
Content-Type: text/html; charset=UTF-8
Content-Transfer-Encoding: quoted-printable

<div dir=3D"ltr">hi, I have several templates that contain some logic at th=
e top; that logic queries the searchList. I would like to put the logic int=
o another template so I can keep one copy of it and call it when I need it.=
<div><br></div><div>The problem I have is that if I call it with #include, =
I get an error on $varExists, presumably because the searchList isn&#39;t y=
et available.=C2=A0</div><div><br></div><div>Has anyone accomplished this? =
Here&#39;s a pseudo example:</div><div>--called template--</div><div><div><=
font face=3D"monospace, monospace">set global procs =3D set()</font></div><=
div><font face=3D"monospace, monospace">#if $varExists(&#39;include&#39;)</=
font></div></div><div><font face=3D"monospace, monospace">=C2=A0 #set globa=
l $procs =3D set({!include})</font></div><div><font face=3D"monospace, mono=
space">#end if</font></div><div><br></div><div>--calling template--</div><d=
iv><font face=3D"monospace, monospace">#include &#39;called-template.tmpl&#=
39;</font></div><div><font face=3D"monospace, monospace">#if $procs</font><=
/div><div>=C2=A0 =C2=A0etc etc</div><div><br></div><div>I want the called-t=
emplate to be input into the calling template and then the whole thing proc=
essed.</div><div><br></div><div>I have tried &#39;#include raw&#39; but the=
n the variable is unknown.</div><div><br></div><div>thanks,</div><div>--Tim=
</div><div><br></div></div>

--047d7ba979d6cf5f0a052d3ae7e3--


--===============0455978545342175359==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

------------------------------------------------------------------------------
Site24x7 APM Insight: Get Deep Visibility into Application Performance
APM + Mobile APM + RUM: Monitor 3 App instances at just $35/Month
Monitor end-to-end web transactions and take corrective actions now
Troubleshoot faster and improve end-user experience. Signup Now!
http://pubads.g.doubleclick.net/gampad/clk?id=272487151&iu=/4140
--===============0455978545342175359==
Content-Type: text/plain; charset="us-ascii"
MIME-Version: 1.0
Content-Transfer-Encoding: 7bit
Content-Disposition: inline

_______________________________________________
Cheetahtemplate-discuss mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/cheetahtemplate-discuss

--===============0455978545342175359==--