Reputation: 113
So, I am trying to load a template based on the current URL, and
For example:
{% if 'foo/bar/gallery' in request.path %}
{% include 'web/custom/foo/bar/gallery.html' %}
{% endif %}
The foo/bar/ is dynamic, as are the directory template locations. The string 'gallery' will always be the same, and can be hardcoded if that matters. How can this be achieved?
FYI: still on django 1.3.7
Upvotes: 0
Views: 100
Reputation: 360
I think that you should avoid the logic in the template. I suggest 2 options :
Upvotes: 1