$ var image = project.getImage(article.value("image")); var contentImageWidth = "#val(contentcopy-max-image-width)"; var defaultImageWidth = 960; // Kann auch "700px" sein, deshalb mit parseInt nur die Zahl holen und trimmen - falls leer, auf default 960 setzen. contentImageWidth = parseInt(contentImageWidth) || defaultImageWidth; var gridCols = article.column.cssClass; if ( gridCols ){ gridCols = parseInt((gridCols.match(/\bc[1-9][0-2]?\b\s?/) || 12).toString().replace("c", "")); } else{ gridCols = 12; } var columnMargin = 30; var columnWidth = ((contentImageWidth + columnMargin) / 12) * gridCols; var contentCopyWidth = parseInt(columnWidth - columnMargin) || defaultImageWidth; //system.log("contentCopyWidth: " + contentCopyWidth + " - image: " + image.name + "( Page " + article.page.name +")"); var imageError = false; if ( !isNull(image) ) { try { var iresult = image.ensureContentCopy(article, contentCopyWidth); var thumbImageWidth = image.contentCopyWidth; var thumbImageHeight = image.contentCopyHeight; var description = image.description; var altText = system.htmlEncode(system.removeHtmlTags(image.altText)); var oldAltText = system.htmlEncode(system.removeHtmlTags(article.valueExpanded("alt", ""))); if ( altText == "" && oldAltText !== "" ){ altText = oldAltText; } var encodedDescription = system.htmlEncode(image.description); var stripDescription = system.htmlEncode(system.removeHtmlTags(image.description)); // strip
-Tags from description as
is not valid inside SPAN description = description.toString().replace(/
/g,"");
description = description.toString().replace(/<\/p>/g,"
");
//system.log("Image Width: " + contentCopyWidth +" / Returned contentCopyWidth:" + thumbImageWidth + " / Image Result: " + iresult);
}
catch(err) {
imageError = true;
}
}
if ( stripDescription !== "" ) {
var showCaption = "1";
}
else {
var showCaption = "0";
}
var lightBox = article.value("lightbox", "lightbox");
var clickURL = article.value("clickurl");
$>
<$ if ( isNull(image) || imageError ) { $>
<$ if ( system.preview ) { $>
Das gewählte Bild ist anscheinend gelöscht worden. Bearbeiten Sie diesen Artikel und wählen Sie erneut ein Bild aus.