[TYPO3-content-rendering] [Typo3-dev] Less features, more future

Ernesto Baschny [cron IT] ernst at cron-it.de
Fri Oct 14 14:59:35 CEST 2005


JoH schrieb am 14.10.2005 13:41:

> Well - it would be nice to get something like this from stdWrap so that an
> admin could assign additional dynamic CSS values to other content elements
> too.
> For extension developers this would mean they have to use the same stdWrap
> function to assign their values. Just to make things as compatible as
> possible.
> 
> Something like
> 
> temp.whatever = COA
> temp.whatever {
>     stdWrap.dynamicCSS_entry = 1
>     stdWrap.dynamicCSS_entry {
>         tag = <div>
>         baseClass = imagecontainer
>         params.cObject = COA
>         params.cObject {
>             text-align = TEXT
>             text-align.field = fieldname
>             width = TEXT
>             width.data = whatever
>             width.wrap = |px
>         }
>     }

Hm, at first I wasn't very sure if that's the right approach, because a
cObject is expected just to return some output and here you are
returning the content and also setting some CSS that TYPO3 has to
include somewhere else.

But then thinking more, that's exactly what we want TYPO3 to do for us,
a feature which would replace all those fontWrap and formatting stuff
that the "good-old" content (default) used to do with stdWrap. Being
able to set this in TypoScript is nice, as we can make use of the
CONSTANT EDITOR etc.

What I don't like is the syntax of the "params", as you call it. A "COA"
is misleading here, because you don't really expect it to contain an
"array of content objects", you want just an array of "TEXT" objects. I
would then rather prefer to provide a new cObject for that purpose,
called "CSS". This is exactly what I suggested some days ago, refer to
my email to typo3-dev list, from 12.10.2005, 15:11, in the thread "Less
features, more future". Browse that email down a bit, to the "CSS" part.

> This would generate an output like
> 
> <div class="imagecontainer" id ="asdf87699876asdf2">
>     #Rest of the COA including wrap, innerWrap, outerWrap etc.
> </div>
> 
> and the appropriate style in the CSS file
> 
> #asdf87699876asdf2 {
>             text-align = left;
>             width = 128px;
> }
> 
> Of course you wouldn't have to use cObject for the params when you are using
> the function inside your own PHP stuff.
> Simply populate an array and you're done.

I think overall it's a nice overall idea and not really much is needed
to have this already working in current TYPO3 in our extentions. I'll
give it a try in cron_cssstyledimgtext as soon as I have some time, and
let's see if we can convince more -core people to enter the discussion. :)


Cheers,
Ernesto



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