Issue
I want to be able to do an if tag based on the current URL value.
for example, if the current page's url is accounts/login/
then don't show a link, without passing a variable from the view.
I am not sure how I can write an {% if %}
tag for this, is it possible?
Solution
If you pass the "request" object to your template, then you are able to use this:
{% if request.get_full_path == "/account/login/" %}
Answered By - Gabriel Ross
0 comments:
Post a Comment
Note: Only a member of this blog may post a comment.