Closed AaronPresley closed 1 year ago
Hi @AaronPresley
I think you're right that this isn't possible, and it is an issue with block
. Nothing outside of block
tags is rendered when using extend
.
My only suggestion would be to make a menu
component instead.
{# menu.html #}
<ul>
<li><a href="#">My DRY Menu</a></li>
</ul>
{# some-page.html #}
{% extends 'base.html' %}
{% block menu_mobile %}{% menu %}{% endblock %}
{% block menu_desktop %}{% menu %}{% endblock %}
{% block content %}
My content here
{% endblock %}
Thanks for verifying, @mixxorz
Firstly, thank you for your work on Slippers!
I've looked through the documentation and can't find something directly answering this question.
Assume I have a base template similar to the following:
Note that since
block
s must have unique names, I'm enable to directly repeat that content despite wanting the exact same markup.I would LOVE to be able to use fragments outside of a
block
, like so:Unfortunately this isn't working in my experimentation. I'm guessing this is a scoping issue with
block
, but figured it was worth confirming whether this is possible.Thanks for your time.