google-code-export / django-page-cms

Automatically exported from code.google.com/p/django-page-cms
BSD 3-Clause "New" or "Revised" License
0 stars 0 forks source link

Preferred method for using pages within rendered views #170

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
Right now, I'm building pages in django-page-cms, but there are a few that
need to be rendered through my custom view. My view looks something like:

def topics(request):
    current_page = Page.objects.get(id=3)
    return render_to_response('pages/topics.html', locals(),
context_instance=RequestContext(request))

However, if in the template I say:

{% if not pages %}
    {% load_pages %}
{% endif %}

It rewrites "current_page" to be None.

This becomes an issue when trying to pull the content for that particular
page like so:

{% placeholder top_summary with TinyMCE %}

What's the preferred method to accomplish this sort of merging?

Original issue reported on code.google.com by intellin...@gmail.com on 28 Sep 2009 at 3:00

GoogleCodeExporter commented 9 years ago
Oki, I have made a modification so current_pages doesn't get to None.

Is that enough to resolve your problem?

Original comment by batiste....@gmail.com on 30 Sep 2009 at 8:16

GoogleCodeExporter commented 9 years ago
Perfect - thanks!

Original comment by intellin...@gmail.com on 30 Sep 2009 at 1:39

GoogleCodeExporter commented 9 years ago

Original comment by batiste....@gmail.com on 30 Sep 2009 at 5:20