I have a Page Model with Tags in it.
class ProjectPage(AbstractContentPage):
tags = ClusterTaggableManager(through=PageTag, blank=True)
content_panels = AppPage.content_panels + [
FieldPanel('tags'),
...
and in the template
{% if page.tags.count %}
<div class="width2">
{% for tag in page.tags.all %}
{# Loop through all the existing tags #}
▶ <a href="{{ self.get_parent.url }}?tag={{ tag.slug }}">{{ tag }}</a><br />
{% endfor %}
</div>
{% endif %}
If The Editor adds 4 Tags to the Tags Field Panel these Tags should appear in same order in the Template. Unfortunately it seems that in the many2many table they get stored always in the order the tags where first created and not in the order they where written in the FieldPanel.
Can someone give me a hint how to change this behavior? I would even try a deep dive in the wagtail source code but I still did not make it to find the place where the Tags get written to the database. (If someone could tell me in which functions wagtail writes the data to the database that would help me too)