如何将自定义模板页面添加到夹层? [英] How to add a custom template page to mezzanine?

查看:130
本文介绍了如何将自定义模板页面添加到夹层?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我已经在夹层玩了几天,我一直在追踪这个博客,这是非常有帮助的。

I've been playing around with mezzanine for a couple days and I've been following this blog, which has been very helpful.

我现在正处于这一点,我需要制作一堆需要基于一个自定义模板。我的自定义模板称为 content.html

I'm now at the point where I need to make a bunch of pages that need to be based off of a custom template. My custom template is called content.html

我把它放在 myProject> ; myApp /主题文件夹>模板>页面> content.html ,但是当我在管理控制台中查看时,我没有在下拉菜单中看到内容。

I've put it in myProject > myApp/theme folder > templates > pages > content.html but when I look in the admin console, I don't see content in the drop down menu.

如何获得夹层以识别我的 content.html 页面作为模板?

How do I get mezzanine to recognize my content.html page as a template?

推荐答案

content.html 不会自动显示在您网站的下拉菜单中。

content.html will not automatically appear in your site's drop down menu.

您需要转到管理员网站,并明确声明一个页面我的内容您要在哪里 content.html 显示在您的页面层次结构中。

You need to go to the admin site and explicitly declare a page my content where you would like content.html to appear in your page hierarchy.

对于夹层来匹配两者(即模板 content.html 和管理页面我的内容):

For mezzanine to match the two (i.e. template content.html and admin page my content):


  1. 我的内容标题字段(管理站点)应为内容

  2. 或URL字段(元数据部分我的内容)应该是内容(如果你决定标题不会是内容),

  3. 或者,如果你想要 content.html 有一个自定义的lug子,说 nicecontent ,然后用 nicecontent 填写URL字段,并添加到 url.py 一个模式对于 content.html 与匹配的插件,所以:

  1. Either my content's Title field (in admin site) should be content,
  2. Or, URL field (in the meta data section of my content) should be content (if you decide the title will not be content),
  3. Or, if you want content.html to have a custom slug, say nicecontent, then fill URL field with nicecontent and add to url.py a pattern for content.html with a matching slug, so:

url("^nicecontent/$", direct_to_template, {"template": "path/to/content.html"}, name="name_for_content").


这篇关于如何将自定义模板页面添加到夹层?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆