Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

{% parent %} tag does not function inside an {% if %} block #41

Closed
elliotf opened this Issue · 3 comments

2 participants

@elliotf

This is likely a problem for more things than the {% if %} block, but when extending a template like so:

{% extends '/layout.html' %}
{% block someblock %}{% if something %}{{ something }}{% else %}{% parent %}{% endif %}{% endblock %}

The parent content does not appear until I move {% parent %} outside the {% if %}. There are also no tests for the {% parent %} tag.

I'm willing to take a crack at fixing this if you let me know your preferred/suggested route.

@paularmstrong

Looks like I forgot to pass parentBlock through to tags. All of the tags will need to accept another parameter, parentBlock (starting here) and send the parentBlock back through the compiler where necessary (like here, but there are many more instances in the tags.js file.

Not sure how I forgot to write any tests for this! Make sure to include them in a patch if you get to this.

@paularmstrong

Also, if you want to take a stab at updating the docs for custom tags when this is fixed, that'd be great, otherwise I'll get to it when I have a chance.

@elliotf

I have some tests already. I'll give this a go this week and will send a pull request.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Something went wrong with that request. Please try again.