List Info

Thread: How to push my attributes in template




How to push my attributes in template
user name
2006-10-26 11:21:14
Hi


I am a newbie in cherrypy.I have layout.kid file. It
contains some menu
items that should be visible in my all pages. (Its just like
a menu)

I have another page named as page.kid. It contains some text
to
display. I wrote <body bgcolor="#ffffff"> in
page.kid.

How can i push the bgcolor attribute in my template. I get
only the
template page body attributes.(layout.kid)

How can i write the template which contain my attributes
whatever i
specified in body tag.

While i run the page in browser, my background color is not
set in
page.kid.

I saw the view source. It replaced the layout.kid body tag.
I need the
body tag attributes whatever specify in page.kid file. How
can i do
this.

Please anyone help me..

The sample output and sample code in the following

==== layout.kid ====

<html xmlns:py="http://purl.org/kid
/ns#">
...
<body onload="foo()" py:match="item.tag ==
'body'">

    <div>
    ... Common content to all pages ...
    </div>

    <div py:replace="[item.text] + item[:]">
    ... page specific content goes here ...
    </div>

</body>
</html>



==== page.kid ===
<html py:extends="'layout.kid'"
xmlns:py="http://purl.org/kid
/ns#">
<body bgcolor="#ffffff">
    <div>
    !! page specific content !!
    </div>
</body>
</html>


==== output ====
...
<body onload="foo()">
    <div>
    ... Common content to all pages ...
    </div>

    <div>
    !! page specific content !!
    </div>
</body>
...


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the
Google Groups "cherrypy-users" group.
To post to this group, send email to cherrypy-usersgooglegroups.com
To unsubscribe from this group, send email to
cherrypy-users-unsubscribegooglegroups.com
For more options, visit this group at ht
tp://groups-beta.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

[1]

about | contact  Other archives ( Real Estate discussion Medical topics )