If LoopDefined

If you want to check whether the loop with a given name is defined in a template AND whether the loop has any output, you can setup a conditional with If.

If the loop has a value or does exist, the values within the If condition will be displayed. 

In Razor:

@if (Loops.Contains("LoopName")) { text to print if condition is met }

In HTML:

<!--@If [Not] LoopDefined(Loop)--> text to print if condition is met <!--@EndIf(Loop)

Notice that the If tags has to end with an EndIf tag in order to work.