我在可编辑字段和夹层表单(即在管理员中创建的标准表单)之间发生冲突。
当我将页面标题设置为“可编辑”时,底部的表单将呈现一个字段来编辑标题,而不是实际的表单。由于仅当您登录时才显示可编辑字段,所以这仅是我登录时的问题。
如果我删除标题上的“可编辑”,则表单将在登录和注销时呈现应有的状态。
导致问题的代码:
<h1>{% editable page.form.title %}{{ page.form.title }}{% endeditable %}</h1>
{% if request.GET.sent %}
<div class="well">
{% editable page.form.response %}
{{ page.form.response|richtext_filter|safe }}
{% endeditable %}
</div>
{% else %}
{% with page.form as page_form %}
{% editable page_form.content %}
{{ page_form.content|richtext_filter|safe }}
{% endeditable %}
<form method="post">
{% fields_for form %}
<input type="submit" value="{{ page.form.button_text }}">
</form>
{% endwith %}
{% endif %}
任何想法非常感谢:)
正如在IRC上讨论的那样,模板中存在名称冲突,夹层中有待解决的问题。
本文收集自互联网,转载请注明来源。
如有侵权,请联系[email protected] 删除。
我来说两句