Design and CSS styles
Version 7.x > Design and CSS styles > First item in repeater different information displayed? View modes: 
User avatar
dbraun-pediatricweb - 4/5/2013 12:19:05 PM
First item in repeater different information displayed?
Is there a way to make the first item in a repeater (like the first office location in a list) display values that are DIFFERENT from the locations? In other words, I have a list of office locations that have name, address, etc. The FIRST item I want only to display the name of the office and its phone number, NOT the address.

User avatar
kentico_sandroj - 4/5/2013 12:31:06 PM
RE:First item in repeater different information displayed?

In order to affect a specific item in a repeater, it is recommended to use hierarchical transformations. Hierarchical transformations are basically nested transformation which allow you to target a specific item using a sub-transformation. These are the available options:

•Item transformation - applied to all displayed items that are not covered by a specialized transformation type (e.g. alternating items, first items etc.).

•Alternating item transformation - applied to items that have an even position in the listing order. Every level in the hierarchy has its own separate alternation pattern.

•First item transformation - applied to the first item on every level in the hierarchy. Only works for levels that contain more than one item.

•Last item transformation - applied to the last item on every level. Only works for levels that contain more than one item.

•Header transformation - rendered at the beginning of every level (before the first item on the level). These transformations provide a convenient way to visually separate or style individual levels.

•Footer transformation - rendered at the end of every level (after the last item on the level). Can be used to close encapsulating elements from the Header.

•Single item transformation - applied in cases where there is only one item on a level in the hierarchy.

•Separator transformation - rendered between items on the same level. It is not placed between items on different hierarchy levels (i.e. between a parent item and its child).

•Current item transformation - applied to the currently selected item (i.e. the document that is being viewed). Please note that it is always necessary to specify a Document type (or types) for this kind of transformation.

If there are multiple sub-transformations being applied to one item, only the highest priority transformation type will be used:

1.Current item (top priority)
2.First/Last/Single item
3.Alternating item

The following link is to an article in the developer's guide that explains how to configure and use hierarchical transformations: Hierarchical transformations

Please let me know if you need any additional clarification on this. Thank you!

Best Regards,
Sandro Jankovic

User avatar
Kentico MVP
Kentico MVP
Brenden Kehren - 4/8/2013 1:52:49 PM
RE:First item in repeater different information displayed?
Take a look in this post, I have a simple way to make this happen without having to complicate it too much.