Typoscript offeres a wrap property for elements. This can be used define surrounding html elements for navigation or list items, content elements or whatever one prefer. In some cases it is necessary to define different wraps depending on an elements position within a list. For example, the first element should get another wrapping as the middle or the last element.

To define this, typoscript uses a definition style like:  ..|..|*|..|..|*|..|..|*|..|..
Here, |*| represents a seperator for the different elements and can be used to define different wraps as for example: [first|normal|last]

If this should be used for a menu, build up with list items, it could be used like this::
1.NO.wrapItemAndSub = <li> | </li> |*| <li> | </li> |*| <li> | </li>

Typo3 Different Wrap Definition for List Elements

Post navigation


Leave a Reply