Meeting Of The Minds

Categories: Community Created by Ernesto Baschny and ben van 't ende
Susanne Moog has been working a lot on content rendering lately. Ernesto Baschny (CRG veteran) and Susanne Moog met in real life on T3DD09. In the spirit of the meeting they sat down together to check Ernesto's work on the single image. Susanne is a new member for the Content Rendering Group.
In core from Susanne currently we have these "major" things (among other minor stuff):
  • Clean up/feature: #10523: New install tool colors, matching t3skin
  • Added feature #10320: Split CSS styled content templates in version templates to get rid of the compat version checks
  • Added feature #5835: get rid of clear.gif with space
  • Fixed bug #9822: New rendering method for content elements (lesser markup, cleaner code)
The last one is very interesting, it cleaned up a lot of "wrapping" that used to occur around content elements. Will be also part of 4.3. Since TYPO3 v4.0 we have an accessible rendering for the content elements "Text with image", which has replaced the "table-based" rendering in the css_styled_content environment. This has worked pretty well in those last 4 years, but there have been some criticisms:
  1. the overhead of the "complex" dl/dt/dd structure if you only want a single image with no caption,
  2. a bug (#3363), where invalid XHTML was created in a situation which was not being handled,
  3. the "unlogical" default rendering of a "dl" list even if the images have no captions.
The idea is that a "definition list" for a set of images only work out if there are a "set of images" (more than one) and that every image has a caption. Otherwise it might be just a "list of images" (ul) or even a single image (img). To cope with those and similar issues that might have appeared for people in those last years, Ernesto has created a mechanism in which those "edge cases" can now be handled via pure TypoScript. As a new default for version 4.3 Ernesto proposed a build-in TypoScript which resolves these issues. It won't affect installations that use "custom" TypoScript. And there is always the "4.2" template which works like it does until now. Here is how it will be done:
rendering {
dl {
# Choose another rendering for special edge cases
fallbackRendering = COA
fallbackRendering {
# Just one image without a caption => don't need the dl-overhead, use the "simple" rendering
10 = TEXT
10 {
if {
isFalse.field = imagecaption
value = 1
equals.data = register:imageCount
}
value = simple
}

# Multiple images and one global caption => "ul"
20 = TEXT
20 {
if {
value = 1
isGreaterThan.data = register:imageCount
isTrue.if.isTrue.data = register:wantsGlobalCaption
isTrue.field = imagecaption
}
value = ul
}

# Multiple images and no caption at all => "ul"
30 = TEXT
30 {
if {
value = 1
isGreaterThan.data = register:imageCount
isFalse.field = imagecaption
}
value = ul
}
}
(...)
}
(...)
simple {
imageRowStdWrap.dataWrap = |
imageLastRowStdWrap.dataWrap = |
noRowsStdWrap.wrap =
oneImageStdWrap.dataWrap = |
imgTagStdWrap.wrap = |
editIconsStdWrap.wrap = |
caption.wrap = <div class="csc-textpic-caption"> | </div>
#imageStdWrap.dataWrap = |
}
}
The patch is still "pending in the core list" and waiting for reviews and approval by other core members.