Michael Gratton wrote:
> I'm looking for a way in a template to insert additional child elements
> in the output of an element that is produced by a layout template that
> the former extends.
> 
> ...
> 
>   <html lang="en">
>     <head>
>       <title><titletext/></title>
>       <link href="chrome/site.css" type="text/css" rel="stylesheet"/>
>       <link href="chrome/special.css" type="text/css" rel="stylesheet"/>
>     </head>
>     <!-- ... -->
>   </html>

Try this:

--- layout.kid ---
<html xmlns:py="http://purl.org/kid/ns#";>
<head>
   <title><titletext/></title>
   <link href="chrome/site.css" type="text/css" rel="stylesheet"/>
</head>
<!-- ... -->
</html>

--- page.kid ---
<html xmlns:py="http://purl.org/kid/ns#";
     py:layout="'layout.kid'">
<head py:match="item.tag == 'head'">
   <meta py:replace="item[:]"/>
   <link href="chrome/special.css" type="text/css" rel="stylesheet"/>
</head>
<!-- ... -->
</html>

You can also do this the other way round:

--- layout.kid ---
<html xmlns:py="http://purl.org/kid/ns#";>
<head py:match="item.tag == 'head'">
   <title><titletext/></title>
   <link href="chrome/site.css" type="text/css" rel="stylesheet"/>
   <meta py:replace="item[:]"/>
</head>
<!-- ... -->
</html>

--- page.kid ---
<html xmlns:py="http://purl.org/kid/ns#";
     py:extends="'layout.kid'">
<head>
   <link href="chrome/special.css" type="text/css" rel="stylesheet"/>
</head>
<!-- ... -->
</html>

Hope that helps.

-- Christoph

-------------------------------------------------------------------------
Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier.
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
_______________________________________________
kid-template-discuss mailing list
kid-template-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss

Reply via email to