Hi,

I'm trying to works with PHPTAL since 2/3 days only.
And I would like to explain how I uses it, to permit to the PHPTAL team
to tell me if I'm wrong.

Example of a very small site :

/index.php  <= a simple homepage
/about.php <= a simple page

So I have 2 templates :
/templates/index.php
/templates/about.php

Like index.php and about.php have the same menu, 
I have added a /templates/macros.html page.
In this macros.html, I have added the menu div with the attribute
metal:define-macro="menu".
In the 2 others templates pages, I have set the menu sample to uses the
macros.html version,
for that I have used metal:use-macro="macros.html/menu" 

Is it the better way to do that ?
May be there is a system to register all macros in memory and to simply
call metal:use-macro="menu" ?


I have done the same for the <head></head> block, like that the <head>
block in macros.html
is already the good one, and others in index.php/about.php are only a
sample <head> block.

But, now I have a more complicated case.
I want to setup one time my <body> tag (so surely in macros.html) and to
ask other templates
to uses this one.
But of course, I don't want to keep the content of the body, I only need
to get the same attributes.

For example, we can say my <body> should be :
<body onload="onLoad();" class="specials classes">

There is a solution for that ?
Or may be there is a better solution, may be it's possible to have a
common.html like that :
<?xml .... ?>
<head>
....
</head>
<body onload="onLoad();" class="specials classes">
  (nothing here)
</body>
</html>

And to tell each time to put the index.php / about.php content of their
<body> into the common.html <body> tag ?

Thanks a lots for your help !

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

Reply via email to