我需要制作一个同页滚动设计,侧边栏上的链接会滚动到同一页面内不同部分的锚点。
我正在尝试使用cmsplugin-sections并在尝试添加节容器时遇到'NoneType'对象不可迭代错误。几天前有人在同一主题上开了一个相同的issue。跟踪下方:
任何帮助都是最受欢迎的,因为我是django-cms的新手。 MAybe另一个具有相同功能的插件?基本上我需要一个自定义文本插件,每个部分都有一个标题字段和一个显示菜单标题。
Environment:
Request Method: GET
Request URL: http://127.0.0.1:8000/en/?edit
Django Version: 1.8.9
Python Version: 2.7.9
Installed Applications:
('djangocms_admin_style',
'django.contrib.auth',
'django.contrib.contenttypes',
'django.contrib.sessions',
'django.contrib.admin',
'django.contrib.sites',
'django.contrib.sitemaps',
'django.contrib.staticfiles',
'django.contrib.messages',
'cms',
'menus',
'sekizai',
'treebeard',
'djangocms_text_ckeditor',
'djangocms_style',
'djangocms_column',
'djangocms_file',
'djangocms_googlemap',
'djangocms_inherit',
'djangocms_link',
'djangocms_picture',
'djangocms_teaser',
'djangocms_video',
'reversion',
'grounded_change',
'cmsplugin_sections')
Installed Middleware:
('cms.middleware.utils.ApphookReloadMiddleware',
'django.contrib.sessions.middleware.SessionMiddleware',
'django.middleware.csrf.CsrfViewMiddleware',
'django.contrib.auth.middleware.AuthenticationMiddleware',
'django.contrib.messages.middleware.MessageMiddleware',
'django.middleware.locale.LocaleMiddleware',
'django.middleware.common.CommonMiddleware',
'django.middleware.clickjacking.XFrameOptionsMiddleware',
'cms.middleware.user.CurrentUserMiddleware',
'cms.middleware.page.CurrentPageMiddleware',
'cms.middleware.toolbar.ToolbarMiddleware',
'cms.middleware.language.LanguageCookieMiddleware')
Template error:
In template /Users/user/templates/fullwidth.html, error at line 7
'NoneType' object is not iterable
1 : {% extends "base.html" %}
2 : {% load cms_tags %}
3 :
4 : {% block title %}{% page_attribute "page_title" %}{% endblock title %}
5 :
6 : {% block content %}
7 : {% placeholder "content" %}
8 : {% endblock content %}
9 :
Traceback:
File "/Users/user/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
response = response.render() File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/response.py" in render
self.content = self.rendered_content File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/response.py" in rendered_content
content = template.render(context, self._request) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/backends/django.py" in render
return self.template.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
return self._render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in _render
return self.nodelist.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
bit = self.render_node(node, context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
return node.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/loader_tags.py" in render
return compiled_parent._render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in _render
return self.nodelist.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
bit = self.render_node(node, context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
return node.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/classytags/core.py" in render
return self.render_tag(context, **kwargs) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/sekizai/templatetags/sekizai_tags.py" in render_tag
rendered_contents = nodelist.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
bit = self.render_node(node, context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
return node.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/classytags/core.py" in render
return self.render_tag(context, **kwargs) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
rendered_contents = nodelist.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
bit = self.render_node(node, context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
return node.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/loader_tags.py" in render
result = block.nodelist.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/base.py" in render
bit = self.render_node(node, context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/django/template/debug.py" in render_node
return node.render(context) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/classytags/core.py" in render
return self.render_tag(context, **kwargs) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in render_tag
content = get_placeholder_content(context, request, page, name, inherit, nodelist) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/cms/templatetags/cms_tags.py" in get_placeholder_content
content = render_placeholder(placeholder, context, name) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_placeholder
content.extend(render_plugins(plugins, context, placeholder, processors)) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/cms/plugin_rendering.py" in render_plugins
out.append(plugin.render_plugin(context, placeholder, processors=processors)) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/cms/models/pluginmodel.py" in render_plugin
context = plugin.render(context, instance, placeholder_slot) File "/Users/user/.virtualenvs/gc/lib/python2.7/site-packages/cmsplugin_sections/cms_plugins.py" in render
for child in instance.child_plugin_instances:
Exception Type: TypeError at /en/
Exception Value: 'NoneType' object is not iterable
答案 0 :(得分:0)
我设法克服了这一点: