Featured photos
Boston Red Sox
Headlines and highlights from the Portland Press Herald/Maine Sunday Telegram
#set($mainImageMaxWidth =305)
#set($mainImageMaxHeight = 200)
#foreach($item in $cms.links("/sports/redsox/",1,1))
#set($myImage = "")
$cms.template("Get Main Image")
#if($mainImage)
#set($newHeight = $mainImage.height)
#set($newWidth = $mainImage.width)
#set($myImage = $util.tag($mainImage))
##1 $newWidth x $newHeight --
#if($newWidth > $mainImageMaxWidth)
#set($newHeight = $math.round($math.multiply($math.divide($mainImageMaxWidth,$mainImage.width),$mainImage.height)))
#set($myImage = $util.resizeImageTag($mainImage,$mainImageMaxWidth,0))
##2 $newWidth x $newHeight --
#end
#if($newHeight > $mainImageMaxHeight)
#set($newWidth = $math.round($math.multiply($math.divide($mainImageMaxHeight,$mainImage.height),$mainImage.width)))
#set($myImage = $util.resizeImageTag($mainImage,0,$mainImageMaxHeight))
##3 $newWidth x $newHeight --
#end
$myImage
#end
$item.title
$item.summary
#end-
#set($smallImageMaxWidth =120)
#set($smallImageMaxHeight = 120)
#foreach($item in $cms.links("/sports/redsox/",2,30))
-
#set($myImage = "")
$cms.template("Get Main Image")
#if($mainImage)
#set($newHeight = $mainImage.height)
#set($newWidth = $mainImage.width)
#set($myImage = $util.tag($mainImage))
##1 $newWidth x $newHeight --
#if($newWidth > $smallImageMaxWidth)
#set($newHeight = $math.round($math.multiply($math.divide($smallImageMaxWidth,$mainImage.width),$mainImage.height)))
#set($myImage = $util.resizeImageTag($mainImage,$smallImageMaxWidth,0))
##2 $newWidth x $newHeight --
#end
#if($newHeight > $smallImageMaxHeight)
#set($newWidth = $math.round($math.multiply($math.divide($smallImageMaxHeight,$mainImage.height),$mainImage.width)))
#set($myImage = $util.resizeImageTag($mainImage,0,$smallImageMaxHeight))
##3 $newWidth x $newHeight --
#end
$myImage
#end
$item.title
$item.summary
#end