-
Notifications
You must be signed in to change notification settings - Fork 40
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.
Already on GitHub? Sign in to your account
Issue with nested templates and child templates with overridden tags that include another template #209
Comments
I've reproduced this in a demo project here: https://github.com/b-ggs/django-pattern-library-issue-209 Seems that the issue happens with these specific conditions:
Templates B and C render properly, but as of |
helenb
changed the title
Issue with templates that
Issue with nested templates and child templates with overridden tags that include another template
Dec 12, 2022
include_block
inside a forloop when added to a story_container
template
I've updated the title to reflect @b-ggs's findings |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Found a bug? Please fill out the sections below. 馃憤
Issue Summary
This issue is present in both 0.7.0 and 1.0.0 versions, but not in 0.6.0
You can repeat the issue by creating a simple template called
test_block.html
that includes another template in a for loop usinginclude_block
test_block.html:
test_block.yaml:
test_block.html
will render by itself in the pattern library without any issue. However, if we have astream_block.html
template that is being used to include some example blocks for apage.body
then we see the bug.Take a page template that includes the following markup:
{% include_block page.body %}
This will repeatedly use a
stream_block
template to render the blocks inpage.body
. The yaml for thestream_block
instructs the pattern library to render another templatestory_container.html
, which is only used by the pattern library, and includes a list of example blocks to be rendered for page templates. If we add ourtest_block.html
to this like so it renders an error:story_container.html
:The error is as follows:
If I change the
include_block
tag intest_block.html
to a simpleinclude
tag and pass it the template name, then the issue no longer occurs. If I change the pattern library version for my project to0.6.0
the issue no longer occurs.Steps to Reproduce
Create a build using pattern library version 0.7.0 or higher
Create a test template as described above, with a forloop and an
include_block
Try adding the test template to a
story_container
type template, being used to render a set of example blocks forpage.body
in the pattern library.Technical details
The text was updated successfully, but these errors were encountered: