I am implementing a directory service and as you know listing URLs appear on a lot of places. I am aware of using the {% url %} tag, it’s still not bullet proof for cases like global listing url structure changes, say I had {% url id=listing.id %} and had to add slug to the URL like {% url id=listing.id slug=listing.slug %}
While global search & replace is an option, however I am curious if there is a canonical way
to approach this issue.
Currently my approach is have a listingurl.html which only has {% url id=listing.id slug=listing.slug %} and wherever needs to have the url will just include listingurl.html, however I am not sure if implementing a custom filter would be more efficient?
Not 100% sure this works and if it is the most elegant solution:
some_template.html
listing.html