IT博客汇
  • 首页
  • 精华
  • 技术
  • 设计
  • 资讯
  • 扯淡
  • 权利声明
  • 登录 注册

    mezzanine自定义category模板样式

    余争的个人页面发表于 2013-09-23 13:11:05
    love 0

    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



沪ICP备19023445号-2号
友情链接