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

JoH info at cybercraft.de
Tue Jul 5 21:29:20 CEST 2005


>> This is your personal opinion - I say <table> - others say <div> -
>> so which is the "only" way to go?
>> The solution is so obvious that everybody seems to overlook it ...
>> Now you can show if you are just a purist fighting against tables or
>> a really flexible inventor ... ;-)
>
> I prefer being the purist. at least when it comes to contentelements
> ;)


Well - since you don't seem to be very creative at the moment I will show
you the flexible solution.
This one is just for "Text with image" but you can do it the same way for
almost any other content element.

tt_content.textpic.20 = TEMPLATE
tt_content.textpic.20 {
    template = FILE
    template.file = whatever.tmpl
    workOnSubpart = DIVBASED
    subparts {
        blah
    }
    marks {
        blubb
    }
}
If you don't like it - change it to:

tt_content.textpic.20 = TEMPLATE
tt_content.textpic.20 {
    template = FILE
    template.file = whatever.tmpl
    workOnSubpart = LISTBASED
    subparts {
        blah
    }
    marks {
        blubb
    }
}

And I can change it to:

tt_content.textpic.20 = TEMPLATE
tt_content.textpic.20 {
    template = FILE
    template.file = whatever.tmpl
    workOnSubpart = TABLEBASED
    subparts {
        blah
    }
    marks {
        blubb
    }
}

Templates can be changed to any personal preferences.
The template file itself will just contain the basic surrounding stuff to
make it work for different solutions.
Functions will provide loops and optionSplits for columns and rows of images
that just select one snippet of the template, replace it with the image,
caption and/or link and fill it back into the parent snippet.
You can even have marks or subparts for inline styles or just parts of them.
This way we get rid of hardcoded stuff in the PHP code.
This means content and rendering will be truly separated from layout.
This way everybody can use a new flexible-styled-content with or without
tables, divs, inline styles or whatever.
This way you can make content elements as flexible as possible without
having to struggle with weird XML-based structures.
Using the "layout" field which is already available for tt_content we could
provide different default templates that can be overridden by TS.

IMHO this is the way to go without new flame wars, since it will be possible
to serve the purists as well as the practitioners ...

Any opinions?

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