Dynamicweb.Rendering Namespace > Template Class : GetLoop Method |
'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!") 'Create a loop in the template 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 'Return the parsed template Return t.Output()
Template t = new Template("MyFolder/MyTemplate.html"); //Set a tag value t.SetTag("MyTag", "Hello world!"); //Create a loop in the template Template loopTemplate = t.GetLoop("MyLoop"); foreach (Content.Page p in Content.Page.GetPagesByAreaID(1)) { loopTemplate.SetTag("PageName", p.MenuText); loopTemplate.CommitLoop(); } //Return the parsed template return t.Output();
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