Skip to content

Commit

Permalink
Add a comment about overriding and a fallback element
Browse files Browse the repository at this point in the history
  • Loading branch information
saevarom committed Jun 15, 2024
1 parent c66d2f9 commit b98823f
Showing 1 changed file with 10 additions and 1 deletion.
11 changes: 10 additions & 1 deletion wagtailcharts/templates/wagtailcharts/blocks/chart_block.html
Original file line number Diff line number Diff line change
@@ -1,3 +1,9 @@
{% comment %}
This is the template for the ChartBlock. It is a simple HTML template that renders a canvas element with the chart data.
You will probably want to override this template by creating a new template in your project with the same name and template path.
The template path is 'wagtailcharts/blocks/chart_block.html'
{% endcomment %}

{% if self.title %}<h3>{{self.title}}</h3>{% endif %}
<canvas
id="chart-{{block.id}}"
Expand All @@ -6,5 +12,8 @@
data-chart-type="{{self.chart_type}}"
aria-label="A chart {% if self.title %} with the title {{self.title}} {%endif%}">
>
<p>Hello Fallback World</p>
<p>
Your browser does not support the canvas element.
This canvas shows a chart {% if self.title %} with the title {{self.title}} {%endif%}
</p>
</canvas>

0 comments on commit b98823f

Please sign in to comment.