[TYPO3-core] Fwd: Bugfix für css-styled IMGTEXT

Sebastian Kurfuerst sebastian at garbage-group.de
Fri Mar 24 18:48:24 CET 2006


Hi,
The base64 encoded stuff doesn't work nicely for me as well - I don't
know if it is just me or also somebody else experiencing that. I have
attached the email and patch again:

Greets, Sebastian

-----

Hi,

anbei ein Patch für aktuellsten TYPO3_4_0 branch aus CVS, der einige
kleinen Bugs mit der CSS-variante für Text mit Bild und Bilder löst.
Beschreibung auf English, ready zum copy&pasten in die core-liste:

Changes with this patch:

    * Now the CSS version of "Text w/images" and "Images" (table-less)
      also respect the textMargin constant so that (finally) the user
      can specify a different margin to separate the image block from
      the text. "colSpacing" now only applies to inter-images spacing,
      which is what the table-based approach also does.
    * For this to work we need to apply two new classes to the images
      (csc-textpic-firstcol and csc-textpic-lastcol). This is
      configurable through an optionSplitted new property
      "addClassesImage" of the USER object
    * Having this also allowed us to fix a bug in positioning: The whole
      image-block can now stretch correctly over the given width without
      any margins around it (which is required if you have just an
      image-block, without text). Without the patch, you always have
      "margin-right" (if images are placed to the left or center) or
      "margin-right" (if images are placed to the right).
    * Fixed also a problem with the calculation of image width if we
      have borders and border-spacings: Now the whole image-block will
      always be exactly maxW wide (so if you have borders and spacing,
      the images will get slightly smaller). Without this, the
      image-block could "explode" a fixed-width layout.

The patch explained (all changes made in the 'diff' output from top to
bottom explained)

typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php:

1) comment was wrong
2) also substract border-spacing (the padding around images and before
the border) in the calculation of the column-width (used later as maxW
for individual images)
3.1) the image-block is now maxW in width, so we just need to calculate
colCount-1 colSpacing. The textMargin is a separate thing that gets
added around the image-block, if there is text to the left or right.
3.2) The $allColumnsWidth was removed as it wasn't being used anywhere.
4.1) here we process the new addClassesImage (through stdWrap and
optionSplit counting the number of columns).
4.2) the columnwidth registry has to skip the margin of the first (or
last) column so that we can apply the textMargin around the whole
image-block
5) adding the calculated classes to each image (firstcol/lastcol)

typo3/sysext/css_styled_content/static/constants.txt:

1) fixed comment: textMargin only applies in "Text with images" elements.
2) added textMargin to our new 4.0-mode constants.

typo3/sysext/css_styled_content/static/setup.txt:

1) added TypoScript handling of the added classes, so that "css-purists"
can get rid of them, if not desired.
2), 3) and 4) adding the class to the correct html markup.
5) P.csc-caption was obsoleted with my last patch (rc1).
6) this is the css-part that is needed to support the textMargin and
intra-images-only margins.


Cheers,
Ernesto


-------------- next part --------------
An embedded and charset-unspecified text was scrubbed...
Name: css_styled_content-imgtext-4.0-rc1.diff
Url: http://lists.netfielders.de/pipermail/typo3-team-core/attachments/20060324/0675a6ea/attachment.diff 


More information about the TYPO3-team-core mailing list