[TYPO3-content-rendering] New and improved css_styled_imgtext

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri Sep 2 19:54:34 CEST 2005


Hi!

After scanning through the "content-rendering" mailing list looking for
a solution and a "working" css-styled-imgtext all I found was a lot of
(sometimes heated! :) ) discussion and no real solution.

That's why I sat down and thought about the problem and tried to solve it.

The problem: Provide rendering methods for the "Text with images" and
"Images" that allows most possible settings for the user, but doesn't
generate any table: just a simple UL (or a DL, or a set of nested DIVs).

As a basis I took the current css_styled_imgtext and the result was this:

http://typo3.org/extensions/repository/new/cron_cssstyledimgtext/

You might thing "o-wheee", yet another extention for the same stuff.
Well, I just didn't want to discuss it while I hadn't something to show.
Who is currently responsible for the css_styled_imgtext and most
importantly: for the css_styled_content and the content rendering in
general in TYPO3-core? See later for my thoughts about the future of this.

First, what does my new extention does what the others doesn't:

Here is a little demonstration: http://www.typo3-anbieter.de/de/csi/

- All positioning actually work, even above-center, below-center, etc.
- The "border" setting is respected as "just another" CSS class added to
the thing. You can then customize the border as you wish in CSS. Default
CSS provides a border just like in content (default) (2px black).
- The user can choose how many columns to display! This was the most
annoying thing in the current original css_styled_imgtext. The
"floathorizontal" field was removed, and code was added to allow images
to wrap in the correct amount of columns.
- The alt and title Attributes for the IMG-tag actually work as you
expect them to: "alt" is always added, even if the value is empty.
"title" is just added if something is entered for this picture in the
"title" field.
- The "noRows" attribute is respected. You might see this working at
http://www.typo3-anbieter.de/de/csi/more/ with example pictures have
sent to the content-rendering list some time ago, while saying it's
"impossible" to do that automatically. Well, as you might see, it does
work! :)
- Intext-Nowrap actually works also on Firefox. This is when the images
column is left "alone", and the text doesn't wrap around it.

I confess I developed these just on IE6 and Firefox, but I can see that
it also works on Opera now. The CSS might still need some tweaking, but
hey, I think this is a step forward.

So now we have this, I would like to talk to people that actually have
access to TYPO3-core or css_styled_content:

What I ultimatively propose is that we make the cObj->IMGTEXT function
do all the "fancy calculation" it has to do (like the column widths,
amount of columns, rows, generate the imgTags, etc) and then call some
registered HOOK (or better yet, call a userFunc specified in
TypoScript!) which then will be able to render this in a meaningful way.
With this approach I don't have to repeat all the calculation code in
every extention, I just have to make good use of it.

With the call of the userFunc in place any extention will be able to
provide a rendering engine. In my proof of concept I am able to render
the block of images as DL, UL and DIVs or even with customizable
stdWrap's (see .customRender property). One site is even able to be
runing multiple rendering engines! The user is able to choose the one
that is most appropriate for the current set of images. This is already
possible with my proof-of-concept.

We also could first try to thing to get this integrated into
css-styled-content, before we make the CORE-thingy.

Well, that's it, let the "flame war begin"! :)

Cheers,
Ernesto



More information about the TYPO3-project-content-rendering mailing list