[PHPTAL] Grabbing the METAL template from an object

Ken Restivo ken at restivo.org
Thu Apr 6 17:45:34 CEST 2006


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

"Fail" in this case means that no substitutions occur.

I get the "main_body_template", but none of my object vars have been swapped in.

Yes, both the metal:define and metal:use-macro are within the same file.

- -ken
- ------------
On Thu, Apr 06, 2006 at 08:32:52AM +0200, Eric Bartels wrote:
> Hi,
> 
> are you within the same template file? What does fail mean?
> Can you give an error message?
> 
> Eric
> 
> Ken Restivo wrote:
> >-----BEGIN PGP SIGNED MESSAGE-----
> >Hash: SHA1
> >
> >I vaguely remember seeing some very simple way to include a macro from an 
> >object. I remember thinking, "Wow, that reminds me of lisp macros, I could 
> >use that some day".
> >
> >Well, that day is now. It turns out I definitely need this functionality, 
> >and I can't find the reference to where I saw how to invoke it.
> >
> >Basically, the METAL template will be in the database, so users can edit 
> >it with a WYSIWYG editor. I fish the user-edited template out of the 
> >database, and now I have to get PHPTAL to use it.
> >
> >My naive attempt-- which failed-- was:
> >
> >    <div metal:define-macro="main_body_macro" 
> >         tal:content="structure page/thank_you_notes/obj/main_body"></div>
> >
> >        <div metal:use-macro="main_body_macro"></div>
> >
> >Which of course failed. How should I be doing this? 
> >
> >- -ken
> >- -- 
> >- ---------------
> >The world's most affordable web hosting.
> >http://www.nearlyfreespeech.net
> >-----BEGIN PGP SIGNATURE-----
> >Version: GnuPG v1.4.1 (GNU/Linux)
> >
> >iD8DBQFENIQHe8HF+6xeOIcRAoRfAKC+uLxPEZ39fisC+CK45+rkkKX/3wCg/kNN
> >UiGQaUBmAte68F5Uk3rDXq0=
> >=AJJy
> >-----END PGP SIGNATURE-----
> >
> >_______________________________________________
> >PHPTAL mailing list
> >PHPTAL at lists.motion-twin.com
> >http://lists.motion-twin.com/mailman/listinfo/phptal
> 
> _______________________________________________
> PHPTAL mailing list
> PHPTAL at lists.motion-twin.com
> http://lists.motion-twin.com/mailman/listinfo/phptal

- -- 
- ---------------
The world's most affordable web hosting.
http://www.nearlyfreespeech.net
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFENTeee8HF+6xeOIcRAkt4AJ4xXQdU9aNlC4sW3pqX6aYA8YVtLwCeK78W
+mvERuZO/kCX4csdCtwoJOs=
=PpDh
-----END PGP SIGNATURE-----



More information about the PHPTAL mailing list