mezzanine自定义category模板样式

原创
2013/09/23 13:11
阅读数 860

Use the mezzanine.blog.models.BlogCategory model for your different blog lists. If you are not happy with 'category/' being in the path, you can copy and modify (below) the mezzanine.blog.urls to your project urls.py.

url("^%s(?P<category>.*)%s$" % _slashes, "mezzanine.blog.views.blog_post_list", name="blog_post_list_category")

To create category templates, take a look at the blog_post_list view and you will see:

templates.append(u"blog/blog_post_list_%s.html" % unicode(category.slug))

To add a template for category "Foo", copymezzanine/blog/templates/blog_post_list.htmlto your projecttemplates/blog/blog_post_list_foo.html. The new template will render if you navigate to /blog/foo/.

http://stackoverflow.com/questions/14418382/customizing-mezzanine

展开阅读全文
打赏
0
0 收藏
分享
加载中
更多评论
打赏
0 评论
0 收藏
0
分享
OSCHINA
登录后可查看更多优质内容
返回顶部
顶部