MPP Zeitgesteuerte Inhalte
Author: th_biedermann
Publication Date: 5/20/2025 9:06
Hallo
Wird der Inhalt veröffentlicht funktioniert die Sichtbarkeit. Will ich innerhalb von FS die Sichtbarkeit prüfen reagiert der Inhalt nicht auf das Datum und Zeit. Wie kann ich das machen?
$-- $CMS_SET(set_visibleMap, {:})$ $CMS_RENDER( template: "get_date_from_date_to", pa_date_from: st_publi_date_from, pa_date_to: st_publi_date_to, pa_visibleMap: set_visibleMap )$ --$ $--$CMS_SET(teaser_visible, true)$--$ $CMS_IF(!pa_date_from.isEmpty())$ $CMS_IF((pa_date_from.format("yyyyMMddHHmm") < #global.now.format("yyyyMMddHHmm")) && (pa_date_to.isEmpty() || pa_date_to.format("yyyyMMddHHmm") > #global.now.format("yyyyMMddHHmm")))$ $CMS_SET(teaser_visible, true)$ $CMS_ELSE$ $CMS_SET(teaser_visible, false)$ $CMS_END_IF$ $CMS_ELSE$ $CMS_IF(pa_date_to.isEmpty() || pa_date_to.format("yyyyMMddHHmm") > #global.now.format("yyyyMMddHHmm"))$ $CMS_SET(teaser_visible, true)$ $CMS_ELSE$ $CMS_SET(teaser_visible, false)$ $CMS_END_IF$ $CMS_END_IF$ $CMS_SET(viod, pa_visibleMap.putAll({ "teaser_visible": teaser_visible }) )$
Der Bubble ist trotz Datum noch sichtbar.
Eingestellt auf 26.6.2025 Zeitschiene auf 27.6.2025 gestellt
Danke für einen Tipp
Grüsse
Thomas
-
Author: hoebbel - 5/20/2025 10:58
Hallo Thomas,
Tipp: MPP ändert nicht #global.now, sondern statt dessen #global.startDate. Deine Überprüfung wird also vom MPP ignoriert.
Und eine Rückfrage: Warum machst Du einen Vergleich von Strings und nicht von den Datumsobjekten direkt? Oder sind das nicht vergleichbare Datumsobjekte?
Viele Grüße
Holger0 -
Author: th_biedermann - 5/20/2025 13:19
Hallo Holger
Danke für den Tipp. Ich habe deinen Rat befolgt und vergleiche nun die Datum korrekt. Jetzt reagiert MPP korrekt
$-- $CMS_SET(set_visibleMap, {:})$ $CMS_RENDER( template: "get_date_from_date_to", pa_date_from: st_publi_date_from, pa_date_to: st_publi_date_to, pa_visibleMap: set_visibleMap )$ --$ $CMS_SET(teaser_visible, ( (pa_date_from.isEmpty() && (pa_date_to.isEmpty() || pa_date_to.after(#global.startDate))) || (!pa_date_from.isEmpty() && !pa_date_from.after(#global.startDate) && (pa_date_to.isEmpty() || pa_date_to.after(#global.startDate))) ) )$ $CMS_SET(viod, pa_visibleMap.put("teaser_visible", teaser_visible))$Grüsse
Thomas
0
Vous devez vous connecter pour laisser un commentaire.
Commentaires
2 commentaires