#13908: contrib.sitemaps.view.index doesn't work in more than one location
-----------------------------------+----------------------------------------
Reporter: palewire | Owner: nobody
Status: new | Milestone:
Component: Contrib apps | Version: SVN
Resolution: | Keywords: sitemaps index pagination
xml
Stage: Unreviewed | Has_patch: 1
Needs_docs: 0 | Needs_tests: 0
Needs_better_patch: 0 |
-----------------------------------+----------------------------------------
Changes (by palewire):
* needs_better_patch: => 0
* has_patch: 0 => 1
* version: 1.1 => SVN
* needs_tests: => 0
* needs_docs: => 0
Comment:
I just added a patch that adds and optional kwarg where you can override
the urlname that the view now reverses by default. So, if you wanted to
use multiple index+section combinations across your site, you could pull
it off by adding that kwarg to your index url. Like so:
{{{
from app1.sitemaps import FakeSitemap
from django.conf.urls.defaults import *
# Sitemaps
sitemaps = {
'fake': FakeSitemap,
}
urlpatterns = patterns('django.contrib.sitemaps.views',
url(r'^sitemap\.xml$', 'index', {
'sitemaps': sitemaps,
'section_urlname': 'app1-sitemap-section',
}, name='app1-sitemap'),
url(r'^sitemap-(?P<section>.+)\.xml$', 'sitemap', {
'sitemaps': sitemaps
}, name='app1-sitemap-section'),
)
}}}
--
Ticket URL: <http://code.djangoproject.com/ticket/13908#comment:1>
Django <http://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.
--
You received this message because you are subscribed to the Google Groups
"Django 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/django-updates?hl=en.