Project

General

Profile

Actions

Feature #18593

closed

Approach for fully scalable layouts: relative img dimensions using em

Added by Ralf Hettinger over 16 years ago. Updated about 6 years ago.

Status:
Closed
Priority:
Should have
Assignee:
-
Category:
Content Rendering
Target version:
-
Start date:
2008-04-09
Due date:
% Done:

0%

Estimated time:
PHP Version:
Tags:
Complexity:
Sprint Focus:

Description

If you try to realize a fully scalable layout with TYPO3, you will soon recognize, that your images won't scale (though the rest of your layout might, if done completely with em units).
This is due to img params being always set based on unit px by css_styled_content+TYPO3 (I'm talking of content images, respectively those images which are passed through tslib_cObj->cImage()).

The following patch implements an approach to make this configurable for css_styled_content.

To enable it for normal content elements and css_styled_content, you need at least
tt_content.image.20.useEM = 1 (default value = 0)

and will f.e. get instead of (I'm omitting the brackets, since they won't show in bugtracker)
img src="..." width="10" height="10"
the corresponding values using the unit em like
img src="..." style="width:0.1em;height:0.1em"
for all tt_content images - and they will scale from now on by changing the font size.

This of course can be used as you just need it - f.e. by not redefining the tt_content.image TS but the according part of "your" styles.content.get ...

Furthermore, there's the property useEM.scaleFactor (default value set to 0.1), which is used when useEM = 1 and then defines the scaling factor for calculating the em unit from the original size of the image in px.
useEM.scaleFactor = 0.1

The following podcast with Thomas Biller demonstrates what a "fully scalable" layout could mean (he doesn't start with that topic, you'll have to watch the whole thing...) :
http://castor.t3o.punkt.de/files/podkast_7mf_css.m4v
(issue imported from #M8070)


Files

8070_4.2.patch (10.6 KB) 8070_4.2.patch Administrator Admin, 2008-04-09 15:58
8070_4.2_v2.patch (10.6 KB) 8070_4.2_v2.patch Administrator Admin, 2008-04-09 18:21
typo3_8070_v4.2.3.patch (11 KB) typo3_8070_v4.2.3.patch Administrator Admin, 2008-12-09 12:36
0008070_4.2.8.patch (11.1 KB) 0008070_4.2.8.patch Administrator Admin, 2009-09-02 11:33
Actions

Also available in: Atom PDF