使用 TurboGears 和 Python 开发 Web 站点
2007-03-30 12:27:33 来源:WEB开发网核心提示: 到产品的链接(list)清单 11. 分类页面 kid 模板文件(category.kid)<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN""http://www.w3.org/
到产品的链接(list)
清单 11. 分类页面 kid 模板文件(category.kid)
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
xmlns:py="http://purl.org/kid/ns#"
py:extends="'master.kid'">
<head>
<title>Category: ${category.name}</title>
</head>
<body>
<div id="breadcrumbs">
<ul>
<li py:for="ancestor in list(category.ancestors)[::-1]">
>
<a href="/category/${ancestor.id}"
py:content="ancestor.name"></a>
</li>
<li id="active">
> <span py:replace="category.name" />
</li>
</ul>
</div>
<div id="subcategories" py:if="category.subcategories">
<div class="header">Subcategories</div>
<ul>
<li py:for="subcategory in category.subcategories">
<a href="/category/${subcategory.id}"
py:content="subcategory.name"></a>
</li>
</ul>
</div>
<div id="subcategories" py:if="category.products">
<div class="header">Products</div>
<ul>
<li py:for="product in category.products">
<a href="/product/${product.id}"
py:content="product.name"></a>
</li>
</ul>
</div>
</body>
</html>
Tags:使用 TurboGears Python
编辑录入:爽爽 [复制链接] [打 印]更多精彩
赞助商链接