Tuesday, July 7, 2009

Custom Frames for Content Elements in Typo3

The "Frame" option for Content Element in Typo3 becomes handy. What if default list does not suit your needs? You need to customize it then.

It is not difficult, event though not very easy to find. The functionality is built upon two different lists. One is a list of frame ids and corresponding labels visible in the BE. For each of these ids the other list defines actual "frame" - wrapper visible in the FE.

The first list is defined in page TSconfig as it is dealing with the back end. Here is an example:
TCEFORM.tt_content.section_frame {
removeItems = 5,6,10,11,12,20,21
altLabels.1 = Rounded
addItems.2 = Highlighted
}
Second line removes all the default items from the list, except for the one with id=1. Third line amends label of that element setting it to 'Rounded'. Finally, the fourth line adds new item to the list with id=2 and label 'Highlighted'.

The second list is defined in TS template as it is dealing with the front end. The example:
tt_content.stdWrap.innerWrap.cObject {
1 = TEXT
1.value = <div class="rounded">|</div>
2 = TEXT
2.value = <div class="highlighted">|</div>
}

5 comments:

  1. Jacek, Great write up on the content frames. I remember trying to figure this stuff out a few years back.

    ReplyDelete
  2. Thanks! I have loads of different Typo3 tricks in my wiki. I was thinking of putting some of them here.

    ReplyDelete
  3. Jacek, thanks for this post! Pozdrowienia!

    ReplyDelete
  4. hi
    thanks for sharing The functionality is built upon two different lists. One is a list of frame ids and corresponding labels visible. your information is different and very valuable for posts.
    typo3 customization

    ReplyDelete
  5. Thank you very much... It is very helpful post

    ReplyDelete