CMS ohne Lizenz MD-File Front-Matter-Felder bug?

Hello. I created some MD files in Elements without a CMS license. I am currently working on an event calendar. To do this, I created an MD file in Elements (see img1), styled everything, and published it—so far, so good. Then I logged into the CMS editor. Img2 and img3 show the fields. When I fill in the fields in the editor and save, the CMS converts everything into an array, even though they are defined as text (as seen in img2—please watch the video). When I log back into the CMS editor, the fields appear as a “list.” I suspect this is a bug, or perhaps it only works correctly if you have a license. Or is there another solution?

in german
Hallo. Ich habe in Elements ohne CMS-Lizenz einige MD-Files erstellt. Derzeit arbeite ich an einen Terminkalender. Dafür habe ich in Elements ein MD File erstellt → siehe img1. Dann habe ich alles gestaltet und veröffentlicht - soweit ok. Dann habe ich mich im CMS-Editor eingeloggt. Img2 und img3 zeigen die Felder. Wenn ich die Felder im Editor ausfülle und speichere, wandelt das CMS alles in ein Array um, obwohl diese als Text definiert sind - wie im img2 zu sehen ist - siehe das Video. Wenn ich dann mich im CMS-Editor neu anmelde, erscheinen dann die Felder als “list”. Jetzt denke ich, dass dies ein Bug ist, oder es liegt daran, dass dies nur korrekt funktioniert, wenn man eine Lizenz hat. Oder gibt es eine andere Lösung dafür?

Grundsätzlich sollten all deine Content Ausgaben in deinem Frontmatter in Anführungszeichen gesetzt werden. Besonders dann wenn Du “Ö - Ä - Ü - ß” oder ähnliche sonderzeichen nutzt. Andernfalls kann elements das frontmatter nicht auslesen bzw. entstehen fehler.

Daher mein TiPP: alles in QUOTES (double quotes) setzen.

titel: “Text Text”
Von: “20m”
Bis: “50m”

English version below!

Danke für die Antwort. Dies habe ich ausprobiert: Ich habe In Elements alle Frontmatter-Felder in Anführungszeichen gesetzt und gespeichert und dann im Editor bearbeitet. IMG10 zeigt, dass auf der Webseite alles funktioniert. IMG11 zeigt, wie Elements die Datei gespeichert hat (Visual Studio Code). Dann habe ich mich im CMS-Editor angemeldet und das Frontmatter “legionsmitglied” von “Ja” auf “nein” gesetzt. Ergebnis siehe img12. Alle Anführungszeichen sind weg, obwohl ich nur ein Feld geändert habe. Dann habe ich den Inhalt des Frontmatter “legionsmitglied” im Editor gänzlich entfernt und gespeichert → siehe img13. Als nächstes habe ich in diesem Feld wieder ein “Ja” eingegeben → siehe img 15 und img14. Es wurde ein Array gebildet, obwohl die Felder im Editor als TEXT definiert sind → siehe img16.

Die vorläufige Erkenntnis daraus: CMS OHNE Lizenz (-> ich habe noch keine): Eine MD-Datei, die von Elements gespeichert wird und Frontmatter-Felder mit Anführungszeichen hat, entfernt die Anführungszeichen im CMS-Editor beim speichern → siehe img17 → ich habe bei diesem Beispiel NUR den Body-Text verändert und keine Frontmatter-Felder. Erstelle ich eine neue MD-Datei direkt im CMS-Editor und fülle ALLE Frontmatter-Felder aus, werden diese OHNE Anführungszeichen gespeichert und es bildet sich keine Arrays → img18. Wenn ich im CMS-Editor eine neue MD-Datei erstelle, ohne das ich die Frontmatter-Felder mit Inhalt ausfülle, speichere die Datei ab → siehe img19, und fülle die Felder nachträglich aus, entstehen Arrays → siehe img20.

Kurz: Wenn ich den Inhalt vorhandener Frontmatter-Felder verändere, speichert der CMS-Editor den Inhalt ohne Anführungszeichen → das “ja” zum “nein” verändern bewirkt, dass kein Array gebildet wird. Löscht man hingegen den vorhandenen Inhalt des Frontmatter-Feldes gänzlich, speichert die Datei und gibt DANN in das Feld einen neuen Text ein, werden die Frontmatter-Felder in Arrays gewandelt (img14).

Nochmals Danke für die Antwort. Wenn Du eine Lizenz hast, teste bitte, ob es dann funktioniert.











English version.
Thanks for the reply. Here is what I tried: I enclosed all frontmatter fields in quotation marks in Elements, saved the file, and then edited it in the editor. IMG10 shows that everything works on the website. IMG11 shows how Elements saved the file (Visual Studio Code). Then I logged into the CMS editor and changed the “legionsmitglied” frontmatter field from “Ja” to “nein”. See img12 for the result. All quotation marks were removed, even though I only changed one field. Next, I completely removed the content of the “legionsmitglied” frontmatter field in the editor and saved → see img13. Then I entered “Ja” in that field again → see img15 and img14. An array was created, even though the fields are defined as TEXT in the editor → see img16.

The preliminary conclusion from this: CMS WITHOUT a license (-> I don’t have one yet): An MD file that is saved by Elements and has Frontmatter fields with quotation marks removes the quotation marks in the CMS editor when saving → see img17 → I ONLY changed the body text in this example and no Frontmatter fields. If I create a new MD file directly in the CMS editor and fill in ALL Frontmatter fields, these are saved WITHOUT quotation marks and no arrays are formed → img18. If I create a new MD file in the CMS editor without filling out the Frontmatter fields with content, save the file → see img19, and fill in the fields later, arrays are created → see img20.

In short: When I modify the content of existing frontmatter fields, the CMS editor saves the content without quotation marks → changing “ja” to “nein” results in no array being formed. If, however, you completely delete the existing content of the front-matter field, save the file, and then enter new text into the field, the front-matter fields are converted into arrays (img14).

Falls überlegt wird, wie ich dies entdeckt habe: Ich benutze einen Code um ein Feld auszulesen, ob und mit welchem Inhalt es gefüllt ist. Damit kann ich eine bestimmte Meldung auf der Webseite erscheinen lassen. Hier der Code:

If you ask how I discovered it: I use a code to read a field to see whether it is filled and with what content. This allows me to display a specific message on the website. Here is the code:

Old Version:
{% if item.legionsmitglied|default('')|trim|lower == 'ja' %}   
Veranstaltung nur für Mitglieder der Legion! 
{% endif %}

New code works with array:

{% if item.legionsmitglied is iterable %}  
{% if item.legionsmitglied[0]|default('')|trim|lower == 'ja' %}    
Veranstaltung nur für Mitglieder der Legion!  {
% endif %}
{% else %}  
{% if item.legionsmitglied|default('')|trim|lower == 'ja' %}   
Veranstaltung nur für Mitglieder der Legion!  
{% endif %}
{% endif %}

Mit dieser Lösung ist es nun egal, ob es ein Array ist oder nicht.

Grüsse Romano

@ben ???