diff --git a/assets/home/script.js b/assets/home/script.js index 351f995..f606c83 100644 --- a/assets/home/script.js +++ b/assets/home/script.js @@ -144,7 +144,11 @@ function initMap() { locationElement.html(locationElement.html().replace('$title', item.title)); locationElement.html(locationElement.html().replace('data-src="$image"', 'src="' + item.image + '"')); locationElement.html(locationElement.html().replace('data-href="$path"', 'href="' + item.path + '"')); - locationElement.html(locationElement.html().replace('$postalCode', (item[textToSlug(locationField)].postalCode + " " + (item[textToSlug(locationField)].addressLocality ?? "")).trim())); + + let location = item[textToSlug(locationField)]; + if (location && location.postalCode) locationElement.html(locationElement.html().replace('$postalCode', (location.postalCode + " " + (location.addressLocality ?? "")).trim())); + else locationElement.find(".postal-code").hide(); + locationElement.removeClass('d-none'); if (item[textToSlug(tagField)]) item[textToSlug(tagField)].slice(0, 2).forEach(function (besonderheitenItem) { diff --git a/content/index.blade.php b/content/index.blade.php index 2833d15..c6e4e55 100644 --- a/content/index.blade.php +++ b/content/index.blade.php @@ -126,7 +126,7 @@

$title

-

$postalCode

+

$postalCode