[TYPO3-content-rendering] A new approach to Content Rendering

JoH info at cybercraft.de
Wed Jul 6 00:51:56 CEST 2005


> I do. I am just wondering how you would assign the styles in the
> header dynamically. what if one uses LI for images and another one
> uses DIVS. what if someones making the "wrap" completely different at
> all?
>
>> There is nothing like "your approach" or "my approach" anymore when
>> we do it like I described.
>
> convince me that it works dynamically and I am on your side

Well - the overall concept would be something like this (example for
"textpic" here since this one seems to be the most complicated element
besides "form"):

Regardless of the template file and the HTML-tags used in it the goal will
be almost the same.
We want to display a Text and an image block using the different options for
positioning that are already available in the BE form.
You will always have a main container surrounding a text and an image block.
The image block will always be a subcontainer with images in columns and
rows.
The different images might have corresponding captions.
You will always use different image widths and heights, border width,
spacing between images (+captions) and between the image block and the main
textblock.
So the function has to deliver just these values and fill them into markers
of the CSS-template.
The template could be looking like this:

.maincontainer {
    ###MC_DISPLAY###
    ###MC_WIDTH###
    ###MC_HEIGHT###
    ###MC_ALIGN###
    ###IC_ALIGN###
}

.imagecontainer {
    ###IC_DISPLAY###
    ###IC_FLOAT###
    ###IC_WIDTH###
    ###IC_HEIGHT###
    ###IC_MARGINTOP###
    ###IC_MARGINRIGHT###
    ###IC_MARGINBOTTOM###
    ###IC_MARGINLEFT###
    ###IC_PADDINGTOP###
    ###IC_PADDINGRIGHT###
    ###IC_PADDINGBOTTOM###
    ###IC_PADDINGLEFT###
}

<!--###IMAGEBOX### begin-->
.imagebox###IBOX_NUMBER### {
    ###IBOX_DISPLAY###
    ###IBOX_FLOAT###
    ###IBOX_WIDTH###
    ###IBOX_HEIGHT###
    ###IBOX_MARGINTOP###
    ###IBOX_MARGINRIGHT###
    ###IBOX_MARGINBOTTOM###
    ###IBOX_MARGINLEFT###
    ###IBOX_PADDINGTOP###
    ###IBOX_PADDINGRIGHT###
    ###IBOX_PADDINGBOTTOM###
    ###IBOX_PADDINGLEFT###
}
<!--###IMAGEBOX### end-->

Same for other objects that might be useful here.
The part for the IMAGEBOX will be looped creating different entries for
image1 to imageX.
Since we are using classes here, it doesn't matter if the element containing
this class is div, table,li or whatever as long as we can assign the correct
properties to it.
And since the user will always be able to extend and/or override this
default behaviour with his own stylesheets and even to disable the default
styles we don't force anybody into anything.

Of course there might be additional identifiers and loops needed to generate
more than one textpic element on one page - but this is just a proof of
concept.

Still interesting?

Joey

-- 
Wenn man keine Ahnung hat: Einfach mal Fresse halten!
(If you have no clues: simply shut your knob sometimes!)
Dieter Nuhr, German comedian
openBC: http://www.openbc.com/go/invuid/Jo_Hasenau





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