Code

Opened 3 years ago

Closed 3 years ago

#15829 closed New feature (fixed)

Provide item to sitemap template

Reported by: manfre Owned by: manfre
Component: contrib.sitemaps Version: master
Severity: Normal Keywords: sitemaps
Cc: Triage Stage: Accepted
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX:

Description

#14041 added the ability to provide a custom template for generating a sitemap. To extend upon that, exposing the item object to the template will allow a way to generate content specific sitemaps (Google News, video, etc) without needing to subclass Sitemap to duplicate most of get_urls.

This could make #10907 (Adding google news sitemap support to django.contrib.sitemaps) unnecessary.

Attachments (3)

sitemaps-item.diff (653 bytes) - added by manfre 3 years ago.
Add "item" to url_info added to context.
sitemaps-item.2.diff (1.3 KB) - added by manfre 3 years ago.
patch with docs
sitemaps-item.3.diff (2.5 KB) - added by manfre 3 years ago.
Patch with added test

Download all attachments as: .zip

Change History (6)

Changed 3 years ago by manfre

Add "item" to url_info added to context.

Changed 3 years ago by manfre

patch with docs

comment:1 Changed 3 years ago by jacob

  • Easy pickings unset
  • Needs documentation unset
  • Needs tests set
  • Patch needs improvement unset
  • Triage Stage changed from Unreviewed to Accepted

Changed 3 years ago by manfre

Patch with added test

comment:2 Changed 3 years ago by anonymous

  • Needs tests unset

Ready for checkin?

comment:3 Changed 3 years ago by jezdez

  • Resolution set to fixed
  • Status changed from new to closed

In [16474]:

Fixed #10907, #14190 and #15829 -- Pass item to sitemaps template to allow further customization like Google News enabled sitemaps. Thanks, manfre and lakinwecker.

Add Comment

Modify Ticket

Change Properties
<Author field>
Action
as closed
as The resolution will be set. Next status will be 'closed'
The resolution will be deleted. Next status will be 'new'
Author


E-mail address and user name can be saved in the Preferences.

 
Note: See TracTickets for help on using tickets.