Prevent image collision between successive Article widgets when the amount of text is
too small to wrap all the way around the entire image. This is done by wrapping the Article in a one-cell table only if the Article contains an image.
This commit is contained in:
parent
92cc42ea15
commit
c45f531b01
1 changed files with 8 additions and 4 deletions
|
|
@ -458,8 +458,12 @@ sub www_view {
|
|||
tie %data, 'Tie::CPHash';
|
||||
%data = getProperties($namespace,$_[0]);
|
||||
if ($data{startDate}<time() && $data{endDate}>time()) {
|
||||
$output = "";
|
||||
if ($data{image} ne "") { # Images collide on successive articles if there is little text - prevent this.
|
||||
$output .= '<table width="100%" border="0" cellpadding="0" cellspacing="0"><tr><td>';
|
||||
}
|
||||
if ($data{displayTitle} == 1) {
|
||||
$output = "<h1>".$data{title}."</h1>";
|
||||
$output .= "<h1>".$data{title}."</h1>";
|
||||
}
|
||||
if ($data{image} ne "") {
|
||||
$image = WebGUI::Attachment->new($data{image},$_[0]);
|
||||
|
|
@ -484,6 +488,9 @@ sub www_view {
|
|||
if ($data{attachment} ne "") {
|
||||
$output .= attachmentBox($data{attachment},$_[0]);
|
||||
}
|
||||
if ($data{image} ne "") {
|
||||
$output .= "</td></tr></table>";
|
||||
}
|
||||
}
|
||||
if ($data{processMacros}) {
|
||||
$output = WebGUI::Macro::process($output);
|
||||
|
|
@ -502,8 +509,5 @@ sub www_view {
|
|||
return $output;
|
||||
}
|
||||
|
||||
|
||||
|
||||
|
||||
1;
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue