Sorry for handling this issue by re-posting, but as it is a rather old post, I am now reposting the matter:
http://developer.dynamicweb-cms.com/forum/development/how-to-make-a-global-loop-in-a-standard.page.onglobaltags-subscriber-1.aspx
The issue here is, that even though I use the suggested approach, my global:loop does not show in DwTemplateTags, nor does it render inside the content module, where the global tags are needed.
This could be a bug or it could be that the appoeach is either insufficient or entirely wrong. Please help out if you can.
My code:
public class NotificationOnGlobalTagsFooterBrands : NotificationSubscriber
{
public override void OnNotify(string notification, Dynamicweb.Extensibility.NotificationArgs args)
{
Dynamicweb.Notifications.Standard.Page.PageviewNotificationArgs a = (Dynamicweb.Notifications.Standard.Page.PageviewNotificationArgs)args;
MrBrand BrandClass = new MrBrand();
List<MrBrand> Brands = BrandClass.GetBrands();
a.Template.SetTag("Global:NIQ:Test", "Global test");
if (a.Template.LoopExists("Global:NIQ:Brandsloop"))
{
Dynamicweb.Templatev2.Template BrandsLoop = a.Template.GetLoop("Global:NIQ:BrandsLoop");
foreach (MrBrand b in Brands)
{
BrandsLoop.SetTag("Global:NIQ:BrandsLoop.Brand", b.Brand);
BrandsLoop.SetTag("Global:NIQ:BrandsLoop.Description", b.Description);
BrandsLoop.SetTag("Global:NIQ:BrandsLoop.Sort", b.Sort);
BrandsLoop.SetTag("Global:NIQ:BrandsLoop.Classification", b.Classification);
BrandsLoop.SetTag("Global:NIQ:BrandsLoop.ShowInFooter", b.Showinfooter);
BrandsLoop.SetTag("Global:NIQ:BrandsLoop.Logolink", b.Logolink);
BrandsLoop.CommitLoop();
}
}
}
}