[PHPTAL] String in HTML Comment/Class definition

2008-09-05 Thread Mathias Jacob
Hi there,

i created a php class named Box which generates me a styled div box and all 
works fine.
Now i want to set the color of the box:

ie: 
!-- start blue box --
div class=panel-blue/div
!-- end blue box --

so, whats the best way to replace the blue in the comment/class? I tried:

!-- start tal:block tal:content=structure color / box --
div class=panel-tal:block tal:content=structure color //div
!-- end tal:block tal:content=structure color / box --

but this didnt work ...

Mathias

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] String in HTML Comment/Class definition

2008-09-05 Thread Christoph Frick
On Fri, Sep 05, 2008 at 12:28:39PM +0200, Mathias Jacob wrote:

 !-- start tal:block tal:content=structure color / box --
 div class=panel-tal:block tal:content=structure color //div
 !-- end tal:block tal:content=structure color / box --

div class=somedefault tal:attributes=class class|default.../div

then call it with 

metal:macro tal:define=class string:someotherclass 
metal:use-macro=somemacro /

-- 
cu


pgpI9GiUEZXNo.pgp
Description: PGP signature
___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] String in HTML Comment/Class definition

2008-09-05 Thread Laurent Bedubourg

Mathias Jacob wrote:

Hi there,

i created a php class named Box which generates me a styled div box and all 
works fine.
Now i want to set the color of the box:

ie: 
!-- start blue box --

div class=panel-blue/div
!-- end blue box --

so, whats the best way to replace the blue in the comment/class? I tried:

!-- start tal:block tal:content=structure color / box --
div class=panel-tal:block tal:content=structure color //div
!-- end tal:block tal:content=structure color / box --

but this didnt work ...



div class=panel-${color}/div

Regards
Laurent
--
Laurent Bedubourg
[EMAIL PROTECTED]
http://www.motion-twin.com

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal


Re: [PHPTAL] String in HTML Comment/Class definition

2008-09-05 Thread Mathias Jacob

 div class=panel-${color}/div
 
 Regards
 Laurent

Thanks, that worked for me! Didn't know that this works too

I'm new to template engines and i don't understand a lot (ie the metal macros) 
... is there a an examples page with examples of basic usage? I mean with 
simple full examples, not only some snippets like in the manual. ie a simple 
(php) project that handles with TAL namespace, one shows METAL namespace and so 
on ... I would really appreciate that!
As you see my English is not the best and its hard to understand the manual 
with some short examples/snippets ...

Regards,
Mathias

___
PHPTAL mailing list
PHPTAL@lists.motion-twin.com
http://lists.motion-twin.com/mailman/listinfo/phptal