Skip to content

Add overridable blocks in checks side panel template #13229

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’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

laymonage
Copy link
Member

To ease customisation of the panel's contents, e.g. for packages to add custom checks.

</div>
</div>
</div>
<div class="w-mt-3">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I changed the top margin here into a w-gap-3 at the parent, seems to still work well.

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Isn’t the parent display: block though?

</div>
{% endblock %}
{% block issues_section %}
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Not sure if we should have some kind of extra_section here. If we should, I'm not sure if it should come before the content metrics, after the issues, or in between them.

It's technically already possible by overriding either the metrics_section or issues_section and using block.super to render the section's original content along with any custom content, e.g.

{% block issues_section %}
    {# This is between the content metrics and issues sections #}
    <div data-custom-section></div>
    {{ block.super }}
    {# This is after the issues section #}
    <div data-custom-section></div>
{% endblock %}

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think block.super is good enough for now!

<h2 class="w-my-5 w-text-16 w-font-bold w-text-text-label">
{% trans 'Content metrics' %}
</h2>
<div class="w-flex w-flex-wrap w-gap-x-10 w-gap-y-4">
Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Added w-flex-wrap and changed w-gap-10 into separate x and y gaps so if you add custom metrics it wraps around nicely. The w-gap-10 is too big of a gap vertically.

@laymonage laymonage requested a review from thibaudcolas July 11, 2025 16:27
@laymonage laymonage self-assigned this Jul 11, 2025
@laymonage laymonage moved this to 👀 In review in Wagtail 7.1* release planning Jul 11, 2025
@thibaudcolas thibaudcolas added type:Cleanup/Optimisation component:Panels component:Design system Including the pattern library (Storybook) AI Language models, machine learning, computer vision labels Jul 12, 2025
@thibaudcolas thibaudcolas added this to the 7.1 milestone Jul 12, 2025
Copy link
Member

@thibaudcolas thibaudcolas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you! I think there are more than enough here, once we’ve tried a few different overrides we can decide which ones to document.

</div>
{% endblock %}
{% block issues_section %}
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yes I think block.super is good enough for now!

@thibaudcolas thibaudcolas merged commit dd3d0c3 into wagtail:main Jul 12, 2025
19 checks passed
@github-project-automation github-project-automation bot moved this from 👀 In review to ✅ Done in Wagtail 7.1* release planning Jul 12, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
AI Language models, machine learning, computer vision component:Design system Including the pattern library (Storybook) component:Panels type:Cleanup/Optimisation
Projects
Status: ✅ Done
Development

Successfully merging this pull request may close these issues.

2 participants