Ilias Lazaridis wrote:
Hi!
I am creating a small website with pudge, which uses kid.
I try to modify a template, thus the selected menu entry appears with a
different style.
<?python
import pudge
def initialize(t):
g = t.generator
if not hasattr(t, 'title'):
t.title = 'Untitled'
t.doc_title = g.index_document['title']
t.home_url = g.organization_url or g.blog_url or g.trac_url
t.home_title = g.organization
t.page_item = 'page_item'
t.filename = {python code to create <filename.extension>, e.g.
"index.html" }
?>
[...]
</head>
<body>
<div id="page">
<h1 class="doc-title"><a href="${home_url}">${home_title}</a></h1>
<div id="navcontainer">
<ul id="navlist">
<li class="pagenav">
<ul>
<li class="${page_item}">
<a href="index.html"
title="Project Home / Index">Home</a>
</li>
here i need the kid function, which does this
<li class= if (filename == index.html) then "page_item" else
"page_item_selected">
ok, found the solution:
${'index.html'== filename and 'page_item_selected' or 'page_item'}
I've looked in the documentation, but could not find an overview of the
functions.
Any comments or suggestions are welcome.
<li class="page_item">
<a href="doc-index.html"
title="${doc_title} Documentation Index">Docs</a>
</li>
.
--
http://lazaridis.com
_______________________________________________
Pudge mailing list
[email protected]
http://lesscode.org/mailman/listinfo/pudge