Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge branch 'develop' of github.com:divio/django-cms into develop

  • Loading branch information...
commit 6982059a8d007f736345fe5f45a623353626218c 2 parents 344c93a + 6765635
@digi604 digi604 authored
View
2  docs/advanced/templatetags.rst
@@ -194,7 +194,7 @@ Example::
{% page_attribute "page_title" request.current_page.parent_id %}
{% page_attribute "slug" request.current_page.get_root %}
-.. versionadded:: 2.3.1
+.. versionadded:: 2.3.2
This template tag supports the ``as`` argument. With this you can assign the result
of the template tag to a new variable that you can use elsewhere in the template.
View
14 docs/extending_cms/placeholders.rst
@@ -58,7 +58,19 @@ Now to render the placeholder in a template you use the
The :ttag:`render_placeholder` tag takes a
:class:`~cms.models.fields.PlaceholderField` instance as its first argument and
optionally accepts a width parameter as its second argument for context sensitive
-plugins.
+plugins. The view in which you render your placeholder field must return the
+:attr:`request <django.http.HttpRequest>` object in the context. This is
+typically achieved in Django applications by using :class:`RequestContext`::
+
+ from django.shortcuts import get_object_or_404, render_to_response
+ from django.template.context import RequestContext
+ from myapp.models import MyModel
+
+ def my_model_detail(request, id):
+ object = get_object_or_404(MyModel, id=id)
+ return render_to_response('my_model_detail.html', {
+ 'object': object,
+ }, context_instance=RequestContext(request))
*******************************
Please sign in to comment.
Something went wrong with that request. Please try again.