Process behaviour with local blocks?
Sherwood Botsford <[email protected]> Sun, 24 Apr 2016 11:55:47 -0600
| Newsgroups | gmane.comp.lang.perl.modules.template-toolkit |
|---|---|
| Message-ID | <CAOX=2F98FYT6O0qjb1EQMrrLjoX8qhwnAEfGrdUzDXrccCP2rg@mail.gmail.com> |
--===============7352993633131413591== Content-Type: multipart/alternative; boundary=001a1134f34867df8e05313ec7e6 --001a1134f34867df8e05313ec7e6 Content-Type: text/plain; charset=UTF-8 I just spent a morning tracking this down: My template typically PROCESSes header.inc, then the main content, then INCLUDEs copyright.inc. header massages a data file and produces all my nav links. But for my error page I did something different and processed the data file differently to make a complete site map. This used a lot of the code that was in header.inc. Anyway: I found out the hard way that if header.inc defines BLOCK foo and then the template also defines BLOCK foo, it is the FIRST definition that wins. The fix was simple: rename them in the special purpose template. Wait: It may matter where I define them. The redefinitions were at the bottom of the file. Anyway, maybe this will save someone some grief. Respectfully, Sherwood of Sherwood's Forests --001a1134f34867df8e05313ec7e6 Content-Type: text/html; charset=UTF-8 Content-Transfer-Encoding: quoted-printable <div dir=3D"ltr"><div><div><div><div><div><div><div><div>I just spent a mor= ning tracking this down:<br><br></div>My template typically PROCESSes heade= r.inc, then the main content, then INCLUDEs copyright.inc.<br><br></div>hea= der massages a data file and produces all my nav links.<br><br></div>But fo= r my error page I did something different and processed the data file diffe= rently to make a complete site map.=C2=A0 <br><br></div>This used a lot of = the code that was in header.inc.<br><br></div>Anyway:=C2=A0 I found out the= hard way that if header.inc defines BLOCK foo and then the template also d= efines BLOCK foo, it is the FIRST definition that wins.<br><br></div>The fi= x was simple:=C2=A0 rename them in the special purpose template.<br><br></d= iv>Wait:=C2=A0 It may matter where I define them.=C2=A0 The redefinitions w= ere at the bottom of the file.<br><br></div>Anyway, maybe this will save so= meone some grief.<br><div><div><div><div><div><div><div><div><div><div><br>= <br><br clear=3D"all"><div><div class=3D"gmail_signature"><div dir=3D"ltr">= <div><div dir=3D"ltr"><div>Respectfully,<br><br>Sherwood of Sherwood's = Forests<br><br></div></div></div></div></div></div> </div></div></div></div></div></div></div></div></div></div></div> --001a1134f34867df8e05313ec7e6-- --===============7352993633131413591== Content-Type: text/plain; charset="us-ascii" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit Content-Disposition: inline _______________________________________________ templates mailing list [email protected] http://mail.template-toolkit.org/mailman/listinfo/templates --===============7352993633131413591==--