Dynamicweb.Rendering Namespace > Template Class : LoopExists Method |
true
if the loop is found in the template; otherwise false
'Load a template from /Files/Templates/MyFolder/MyTemplate.html Dim t As New Template("MyFolder/MyTemplate.html") 'Set a tag value t.SetTag("MyTag", "Hello world!") 'Check if the loop exists in template before getting the data If t.LoopExists("MyLoop") Then Dim loopTemplate As Template = t.GetLoop("MyLoop") For Each p As Content.Page In Content.Page.GetPagesByAreaID(1) loopTemplate.SetTag("PageName", p.MenuText) loopTemplate.CommitLoop() Next End If
Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2