Search code examples
content-management-systemreddot

How do I determine the length of a list in RedDot/OpenText?


I have a page with a list element attached. How do I determine the number of items in that list? Can use render tags, asp, or any other technique (so long as it works!)


Solution

  • Reading the render tags documentation I believe it may be possible to do this in a nicer way

    So getting the list Element using this

    Context:CurrentPage.Elements.GetElement(lst_myPages).Value

    The Value property should return a page collection for list items so you should be able to do

    Context:CurrentPage.Elements.GetElement(lst_myPages).Value.Count