Revision: 623
Author: batiste.bieler
Date: Fri Jul 31 01:14:09 2009
Log: Add a PAGE_HIDE_ROOT_SLUG option to the setting with False as default
value
http://code.google.com/p/django-page-cms/source/detail?r=623
Modified:
/trunk/pages/models.py
/trunk/pages/settings.py
=======================================
--- /trunk/pages/models.py Fri Jul 31 01:06:52 2009
+++ /trunk/pages/models.py Fri Jul 31 01:14:09 2009
@@ -177,7 +177,7 @@
url = cache.get(self.PAGE_URL_KEY % (self.id, language))
if url:
return url
- if self.is_first_root():
+ if settings.PAGE_HIDE_ROOT_SLUG and self.is_first_root():
url = ''
else:
url = u'%s/' % self.slug(language)
=======================================
--- /trunk/pages/settings.py Wed Jul 15 01:56:17 2009
+++ /trunk/pages/settings.py Fri Jul 31 01:14:09 2009
@@ -120,6 +120,9 @@
PAGES_MEDIA_URL = getattr(settings, 'PAGES_MEDIA_URL',
join(settings.MEDIA_URL,
'pages/'))
+# Hide the slug's of the first root page ie: ``/home/ becomes ``/``
+PAGE_HIDE_ROOT_SLUG = getattr(settings, 'PAGE_SHOW_END_DATE', False)
+
# Show the publication start date field in the admin. Allows for future
dating
# Changing the ``PAGE_SHOW_START_DATE`` from ``True`` to ``False``
# after adding data could cause some weirdness. If you must do this, you
--~--~---------~--~----~------------~-------~--~----~
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
-~----------~----~----~----~------~----~------~--~---