I have one section with different entry types. One entry type uses two matrix fields, another one only one, and so on.
Since the frontend layout is always the same, I use one template for the whole section:
{% extends "_layouts/main" %}
{% set title = entry.title %}
{% block content %}
{% include "_fields/content__circles" %}
{% include "_fields/content__body" %}
{% include "_fields/content__links" %}
{% endblock %}
This works great, except when I change an entry to another entry type: Because the field-data isn't deleted from the db and shows up anyway, even though the field isn't added to the new entry type.
This is actually great, because that way your data isn't gone if you delete a field by mistake etc., but over time the db gets bloated, which I want to prevent.
Question: How can I delete data of fields which aren't used without editing each entry by hand or going in the db?
Clearification: entrytype 1 has content__circles
and content__body
, entrytype 2 has only content__body
. After switching from type 1 to 2, the data of content__circles
is still kept in the database, and is even accessible inside the entry
-variable.
entry
-object? The field had content in entrytype1, but this field isn't available anymore in the entrytype2, so shouldn't the old field-data be excluded/deleted? – Victor In Oct 11 '14 at 13:29