[TYPO3-core] RFC: Fix bug #3138: css_styled_content margin bug

Martin Kutschker Martin.Kutschker at n0spam-blackbox.net
Wed May 17 12:24:04 CEST 2006


Ernesto Baschny [cron IT] schrieb:
> Martin Kutschker schrieb am 17.05.2006 11:10:
> 
> 
>>Ernesto Baschny [cron IT] schrieb:
>>
>>>Solution:
>>>    For Firefox/Gecko we set a margin-left on the text block so that
>>>    it is aligned right to the images-floated-block. This was not
>>>    regarding the text-margin which was added in RC3. As this is
>>>    done in TypoScript, I added a new register that includes the
>>>    image block width and also the text-margin.
> 
> 
>>"rowwidthwithtextmargin"? argh!
>>How about "rowwidthplustextmargin" or simple "rowwidthtextmargin"?
>>
>>Ok, it's only registers but the readability of "rowwdith" is not very
>>good. Please, let's use interCaps for registers as well: "rowWidth"
> 
> 
> I agree, but the "rowwidth" register is already been used since RC2, I
> wouldn't want to change that now and break backwards-compatibility.
> 
> So I changed my patch so that there isn't the need for such a bizarre
> register anymore. The plugin now just sets the registers "rowwidth" and
> "textMargin". TS-setup is what calculates the margins at the place where
> they are actually being used (in the two "nowrap" layouts).
> 
> 
>>But anyway +1
> 
> 
> Thanks. But please review the new attached patch.
> 
> 
>>Note: don't add the Changelog to your diff.
>>Tip: create the Changelog entry when the path got the ok.
> 
> 
> I don't understand why? I would also like people to review my changelog
> entry before I commit it to CVS. Or is there any reason not to have it
> in the diff?
> 
> Cheers,
> Ernesto
> 
> 
> ------------------------------------------------------------------------
> 
> Index: typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php
> ===================================================================
> RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php,v
> retrieving revision 1.5.2.8
> diff -u -r1.5.2.8 class.tx_cssstyledcontent_pi1.php
> --- typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php	6 Apr 2006 13:49:42 -0000	1.5.2.8
> +++ typo3/sysext/css_styled_content/pi1/class.tx_cssstyledcontent_pi1.php	17 May 2006 10:00:46 -0000
> @@ -645,6 +645,7 @@
>  			// How much space will the image-block occupy?
>  		$imageBlockWidth = max($imageRowsFinalWidths)+ $colspacing*($colCount-1) + $colCount*$border*($borderSpace+$borderThickness)*2;
>  		$GLOBALS['TSFE']->register['rowwidth'] = $imageBlockWidth;
> +		$GLOBALS['TSFE']->register['textMargin'] = $textMargin;
>  
>  			// noRows is in fact just one ROW, with the amount of columns specified, where the images are placed in.
>  			// noCols is just one COLUMN, each images placed side by side on each row
> Index: typo3/sysext/css_styled_content/static/setup.txt
> ===================================================================
> RCS file: /cvsroot/typo3/TYPO3core/typo3/sysext/css_styled_content/static/setup.txt,v
> retrieving revision 1.5.2.9
> diff -u -r1.5.2.9 setup.txt
> --- typo3/sysext/css_styled_content/static/setup.txt	6 Apr 2006 22:32:18 -0000	1.5.2.9
> +++ typo3/sysext/css_styled_content/static/setup.txt	17 May 2006 10:00:46 -0000
> @@ -1307,13 +1307,21 @@
>  		18 = TEXT
>  		18.value = <div class="csc-textpic csc-textpic-intext-left###CLASSES###">###IMAGES######TEXT###</div>
>  		# intext-right-nowrap
> -		25 = TEXT
> -		25.value = <div class="csc-textpic csc-textpic-intext-right-nowrap###CLASSES###">###IMAGES###<div style="margin-right:{register:rowwidth}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div>
> -		25.insertData = 1
> +		25 = COA
> +		25.1 = LOAD_REGISTER
> +		25.1.nowrapMargin {
> +			cObject = TEXT
> +			cObject.value = {register:rowwidth}+{register:textMargin}
> +			cObject.insertData = 1
> +			prioriCalc = intval
> +		}
> +		25.2 = TEXT
> +		25.2.value = <div class="csc-textpic csc-textpic-intext-right-nowrap###CLASSES###">###IMAGES###<div style="margin-right:{register:nowrapMargin}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div>
> +		25.2.insertData = 1
> +		25.3 = RESTORE_REGISTER
>  		# intext-left-nowrap
> -		26 = TEXT
> -		26.value = <div class="csc-textpic csc-textpic-intext-left-nowrap###CLASSES###">###IMAGES###<div style="margin-left:{register:rowwidth}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div>
> -		26.insertData = 1
> +		26 < .25
> +		26.2.value = <div class="csc-textpic csc-textpic-intext-left-nowrap###CLASSES###">###IMAGES###<div style="margin-left:{register:nowrapMargin}px;">###TEXT###</div></div><div class="csc-textpic-clear"><!-- --></div>
>  	}
>  
>  	rendering {



More information about the TYPO3-team-core mailing list