[TYPO3-content-rendering] Smart Content Rendering (was: Re: [Typo3-dev] Less features, more future)

Ingmar Schlecht ingmar at typo3.org
Mon Oct 24 05:45:52 CEST 2005


Hi Joey,

JoH wrote:
> This brings me to the major issue when it comes to a new concept of  "smart
> content rendering".

I agree with you, that the way most of the TYPO3 extensions render their 
content is far from perfect, because separation between the main logic 
of the extension and the layout is often not there at all.

> 1. No hardcoded [..] tags in the PHP files [..]. They should be
> replaced with TypoScript settings.

Do you think of something like the following here?

plugin.tx_myext_pi1 {
   globalWrap = <div><ul>|</ul></div>
   imgWrap = <li>|</li>
   captionWrap = <p>|</p>
   captionBeforeImg = 1
}

IMHO that is not intuitive to use, because all the properties' names 
like "globalWrap" are "invented" by the extension author and have to be 
learnt or looked up by the user.

Apart from that, it also restricts the user to a certain order of things.

A better way would be using the ###MARKER### template way:

<div>
     <ul>
       <!-- ###ROWS### begin -->
         <li>
            <!-- ###IMAGE### -->
            <!-- ###CAPTION### -->
         <li>
       <!-- ###ROWS### end -->
     </ul>
</div>

But even that way restricts you in how you can output your content, 
because they are not "intelligent".

Imagine you'd like to output your content in a table like this:

<tr> ITEM1 ITEM2 ITEM3  </tr>
<tr> ITEM4 ITEM5 ITEM6  </tr>
<tr> ITEM7 ITEM8  </tr>

(<td> tags are left out to make reading easier. Imagine them around the 
items.)

This won't work with ###MARKER### templates for two reasons:
  - you can't make it begin a new <tr> row each two rows.
  - you can't make it output colspan="2" for the last item

In order to fix the first problem, you could ask the extension author to 
create TS properties "useRows = 1" and "itemsPerRow = 3", but IMHO the 
main extension logic PHP should not worry at all about the layout.

What we need is a "smart" way of content rendering, that is as simple to 
use as the ###MARKER### way for simple scenarios, but can cope with more 
advanced "layout logic" too.

I think PHP offers pretty much all to build something like that.

cheers,
Ingmar



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