Skip to content

Commit

Permalink
Disable imageheight and imagewidth for textpic and image content elem…
Browse files Browse the repository at this point in the history
…ents to avoid wrong rendering
  • Loading branch information
benjaminkott committed Aug 5, 2014
1 parent 16a6f99 commit e2e19f6
Show file tree
Hide file tree
Showing 2 changed files with 24 additions and 0 deletions.
9 changes: 9 additions & 0 deletions Classes/Hooks/DataHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -63,5 +63,14 @@ public function processDatamap_preProcessFieldArray(&$incomingFieldArray, $table
$incomingFieldArray['pi_flexform']['data']['sDEF']['lDEF']['acctables_nostyles']['vDEF'] = 1;
$incomingFieldArray['pi_flexform']['data']['sDEF']['lDEF']['acctables_tableclass']['vDEF'] = implode(" ",$acctables_tableclasses);
}

/**
* Unset height and width for textpic and image to avoid wrong image rendering
*/
if($table == 'tt_content' && ($incomingFieldArray['CType'] == 'textpic' || $incomingFieldArray['CType'] == 'image')){
$incomingFieldArray['imageheight'] = '';
$incomingFieldArray['imagewidth'] = '';
}

}
}
15 changes: 15 additions & 0 deletions Configuration/PageTS/tsconfig.txt
Original file line number Diff line number Diff line change
Expand Up @@ -121,6 +121,21 @@ TCEFORM {
disableNoMatchingValueElement = 1
}

// Disable imageheight and imagewidth for textpic and image
// to avoid incorrect rendering in frontend
imageheight {
types {
textpic.disabled = 1
image.disabled = 1
}
}
imagewidth {
types {
textpic.disabled = 1
image.disabled = 1
}
}

// NOBODY wants or should edit this - really, let them disappear
table_bgColor.disabled = 1
table_border.disabled = 1
Expand Down

0 comments on commit e2e19f6

Please sign in to comment.