How to push my attributes in template

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|

How to push my attributes in template

Mahabub Basha

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 [hidden email]
To unsubscribe from this group, send email to [hidden email]
For more options, visit this group at http://groups-beta.google.com/group/cherrypy-users
-~----------~----~----~----~------~----~------~--~---

Reply | Threaded
Open this post in threaded view
|

Re: How to push my attributes in template

Robert Brewer

Basha wrote:
> 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.

Although you may get an answer here, I wouldn't hold my breath. You're
better off asking on the Turbogears or Kid mailing lists or IRC
channels.

http://groups.google.com/group/turbogears
https://lists.sourceforge.net/lists/listinfo/kid-template-discuss


Robert Brewer
System Architect
Amor Ministries
[hidden email]

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