我在使用Django CMS 3设置菜单时遇到问题。
我确实向cms添加了这样的页面:
Home Teachers (id teachers) Contact Info现在我可以只为这样的“老师”添加我的菜单(在我的老师/ templates / teachers_index.html中):
{% show_menu_below_id "teachers" 0 100 100 100 %}在主项目的urls.py中,我有这一行,所以我添加了教师应用程序中的所有网址:
url(r'^teachers/', include('myapp.apps.teachers.urls', namespace='teachers')),在myapp.app.teachers.urls中:
url(r'^$', views.index, name='index')现在我认为所有基本上都设置了,但它不是:(
我认为一个网址:教师/联系人现在会去教师应用程序,但事实并非如此。 它只是加载主应用程序模板而不是教师应用程序中的模板。
所以我想我必须以某种方式将CMS连接到教师应用程序? 但我真的没有任何线索。 我希望我的问题很清楚,有人可以指出我正确的方向吗?
I have trouble setting up my menu with Django CMS 3.
I did add pages to the cms like this:
Home Teachers (id teachers) Contact InfoNow i can add my menu for only "teachers" like this (in my teachers/templates/teachers_index.html):
{% show_menu_below_id "teachers" 0 100 100 100 %}In my urls.py from the main project, I have this line, so I add all the urls from the teachers app:
url(r'^teachers/', include('myapp.apps.teachers.urls', namespace='teachers')),And in myapp.app.teachers.urls:
url(r'^$', views.index, name='index')Now i would think all was basically set, but it is not :(
I thought an url like: teachers/contact would now go to the teachers app, but it is not. It just loads the main app template and not the one from the teachers app.
So i think i have to connect the CMS somehow to the teachers app? But i realy have no clue at all. I hope my question is clear and that someone can point me in the right direction?
最满意答案
好的,再次感到愚蠢......以下是如何做到的:
在设置中添加模板:
CMS_TEMPLATES = ( ('three_columns.html', 'Three columns'), #default one ('teachers_index.html', 'Three columns teachers'), #new one )然后在CMS中:编辑页面>高级设置>选择模板:)
Ok, feeling stupid again... Here is how to do it:
In settings add the template:
CMS_TEMPLATES = ( ('three_columns.html', 'Three columns'), #default one ('teachers_index.html', 'Three columns teachers'), #new one )and then in the CMS: edit page > advanced settings > choose template :)
更多推荐
发布评论