Hi Wavy, note that at some point (before 0.9) the master template will be cleaned up and these thing will be moved to the sitetemplate:
http://trac.turbogears.org/turbogears/ticket/107 Ciao Michele Wavy Davy wrote: > Heya all > > Due to the new widget code in development, the quickstart master.kid > (as of r243 anyway) has some code to support per widget css/js. All > well and good, except that now I can't view the master template in a > browser cleanly as this code produces viewable results (I see all the > '$css.insert()'s). > > Given the ability to view/edit kid templates in a browser is a strong > feature of kid, I would suggest changing the code to use > py:replace="content" rather than $content. This way, no content is > displayed in the kid template when viewed in a browser. Trivial patch > included for master.kid. > > While I'm thinking about it, what about a default stylesheet link to save > time? > > i.e. > > <link type="text/css" rel="StyleSheet" href="../static/css/style.css" > py:attrs="{'href':'/static/css/style.css'}" /> > > There doesn't need to be a stylesheet there, but then all the user has > to do is pop a style.css in static/css, and it's linked in already. > Plus, the double href thing works both when viewed directly or server > by tg. The following patch included this addition. > > Hope this is helpful :) > > --- old.master.kid 2005-11-24 18:40:41.049302000 +0000 > +++ master.kid 2005-11-24 19:08:21.192250000 +0000 > @@ -5,18 +5,19 @@ > <head py:match="item.tag=='{http://www.w3.org/1999/xhtml}head'"> > <meta content="text/html; charset=UTF-8" > http-equiv="content-type" py:replace="''"/> > <title py:replace="''">Your title goes here</title> > - <link py:strip="1" py:for="css in tg_css">${css.insert()}</link> > - <link py:strip="1" py:for="js in tg_js_head">${js.insert()}</link> > + <link py:for="css in tg_css" py:replace="css.insert()" /> > + <link py:for="js in tg_js_head" py:replace="js.insert()" /> > + <link type="text/css" rel="StyleSheet" > href="../static/css/style.css" > py:attrs="{'href':'/static/css/style.css'}" /> > <meta py:replace="item[:]"/> > </head> > > <body py:match="item.tag=='{http://www.w3.org/1999/xhtml}body'"> > - <div py:strip="1" py:for="js in tg_js_bodytop">${js.insert()}</div> > + <div py:for="js in tg_js_bodytop" py:replace="js.insert()" /> > <p align="center"><img > src="/tg_static/images/tg_under_the_hood.png"/></p> > > <div py:if="tg_flash" class="flash" py:content="tg_flash"></div> > > <div py:replace="item[:]"/> > - <div py:strip="1" py:for="js in tg_js_bodybottom">${js.insert()}</div> > + <div py:for="js in tg_js_bodybottom" py:replace="js.insert()" /> > </body> > </html> > > > -- > wavy davy > > "True religion confronts earth with heaven > and brings eternity to bear on time" > - A. W. Tozer

