Revision: 615
Author: chris.vigelius
Date: Thu Jul 23 06:21:29 2009
Log: 1.) added missing template for pages_breadcrumb tag
2.) added 'current_page' context parameter to load_pages tag

http://code.google.com/p/django-page-cms/source/detail?r=615

Added:
  /trunk/pages/templates/pages/breadcrumb.html
Modified:
  /trunk/pages/templatetags/pages_tags.py

=======================================
--- /dev/null
+++ /trunk/pages/templates/pages/breadcrumb.html        Thu Jul 23 06:21:29 2009
@@ -0,0 +1,4 @@
+{% load pages_tags cache %}
+{% for page in pages %}
+<a href="{% show_absolute_url page %}">{% show_content page "title" %}</a>  
&raquo;
+{% endfor %}<a href="{% show_absolute_url page %}">{% show_content  
page "title" %}</a>
=======================================
--- /trunk/pages/templatetags/pages_tags.py     Tue Jul 21 01:02:49 2009
+++ /trunk/pages/templatetags/pages_tags.py     Thu Jul 23 06:21:29 2009
@@ -8,7 +8,7 @@
  import urllib

  from pages import settings
-from pages.models import Content, Page
+from pages.models import Content, Page, PageAlias
  from pages.http import get_language_from_request

  register = template.Library()
@@ -217,6 +217,11 @@
      def render(self, context):
          if (not context.has_key('pages')):
              context['pages'] = Page.objects.navigation()
+        request = context['request']
+        if (not context.has_key('current_page')):
+            alias = PageAlias.objects.get_for_url(request, request.path)
+            if alias:
+                context['current_page'] = alias.page
          return ''

  def do_load_pages(parser, token):

--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"pinax-updates" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to 
[email protected]
For more options, visit this group at 
http://groups.google.com/group/pinax-updates?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to