Author: batiste.bieler
Date: Fri May 15 05:26:26 2009
New Revision: 530
Modified:
trunk/example/templates/pages/index.html
trunk/pages/templatetags/pages_tags.py
Log:
Fix issue 102
Modified: trunk/example/templates/pages/index.html
==============================================================================
--- trunk/example/templates/pages/index.html (original)
+++ trunk/example/templates/pages/index.html Fri May 15 05:26:26 2009
@@ -96,8 +96,9 @@
<h2>Content</h2>
{% if current_page %}
-<p>Page absolute url : {% show_absolute_url current_page %}</p>
-<p>Page absolute url using the page slug : {% show_absolute_url
current_page.slug %}</p>
+<p>Test for page absolute url : {% show_absolute_url current_page %}</p>
+<p>Test for page absolute url using the page slug : {% show_absolute_url
current_page.slug %}</p>
+<p>Test show_content and get_content template tag : {% show_content
current_page.slug "slug" %} {% get_content current_page.slug "slug" as
content %}</p>
{% endif %}
{% placeholder right-column with RichTextarea parsed as right_column %}
Modified: trunk/pages/templatetags/pages_tags.py
==============================================================================
--- trunk/pages/templatetags/pages_tags.py (original)
+++ trunk/pages/templatetags/pages_tags.py Fri May 15 05:26:26 2009
@@ -25,17 +25,15 @@
else:
lang = get_language_from_request(context['request'], page)
+ c = ''
# if the page is a SafeUnicode, try to use it like a slug
- if isinstance(page, SafeUnicode):
+ if isinstance(page, SafeUnicode) or isinstance(page, unicode):
c = Content.objects.filter(type='slug', language=lang, body=page)
if len(c):
page = c[0].page
- else:
- ''
- c = Content.objects.get_content(page, lang, content_type, fallback)
- if c:
- return c
- return ''
+ else:
+ c = Content.objects.get_content(page, lang, content_type, fallback)
+ return c
"""Fitlers"""
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---