Table of Contents

Content Lists

you are here (click to zoom) - discover the stack

Any View can be configured to be a List of Content Items, and if it is a list, it can also have a Header Item.

When a View is a List...

  1. All Content Items in the List share the same Content-Type - like BlogPost
  2. Each item in the list can have it's own Presentation Settings but these settings all share the same Content-Type - like BlogPresentation
  3. Lists can have a single Header item of another Content-Type - like BlogIntro
  4. If the list has a Header it can also have a Header Presentation of a type like BlogIntroPresentation
  5. the first item in the List is still given to the Template as the Content variable
  6. Lists preserve the order of the items added to it
  7. The automatic toolbars change a bit when a list is being used

Use in Code

In C# you will usually do things like @foreach(var item in AsList(Data)) { ... } or similar. Check the C# API Docs for this.

In Tokens you there is a special <repeat> tag. Check the Tokens docs.

History

  1. Introduced in 2sxc v2.0
  2. API was improved in 2sxc 8
  3. The Header name was introduced to replace the confusing ListContent name in v10