Ok, I see it now - {% if ... %} is the tag. The parameter to the if tag is expected to be either a literal string or a context variable, not another tag.
That’s why it’s not working, and why you need to use as as described in the previous comment.
I know it’s a different thing. It’s also the appropriate thing in this situation. Your code currently has two lines (the load and the as call to the tag) that are wholly redundant and honestly wrong. This is not what tags are for. (Also, give credit where credit is due, it was aneftas solution, not Kens).
The appropriate solution is just {% if request.path == ‘/’ %} and it will work without tag or processor but one of the use cases of tags is conditional rendering of the template like what {% if %} is doing. I just wanted my own condition here and it works as I expected.
True. Just checking the path directly is probably sufficient in this case.
but one of the use cases of tags is conditional rendering of the template
Well… yea, if you create a new tag like {% if_homepage %}, but you created a tag that returns a bool. That doesn’t make much sense and is a misuse of tags.
No. It does not. forloop.first is a boolean, but {% if %} renders it’s content if the expression is truthy. The distinction is quite important. If {% if forloo.first %} returned a boolean, then:
{% for x in y %}
{% if forloop.first %}
{% endfor %}
would print True once. It does not. It’s in fact a syntax error and will not parse.