protected override void OnInit(EventArgs e)
 {
     base.OnInit(e);
     var placeholder = new BootstrapGridModulePlaceholder();
     placeholder.Provider = typeof(UmbracoTreeModuleProvider).GetShortAssemblyName();
     placeholder.ReferenceId = CmsService.Instance.GetItem<Entity>().Id.ToString();
     placeholder.Key = Key;
     Controls.Add(placeholder);
 }
        protected override void OnInit(EventArgs e)
        {
            base.OnInit(e);

            if (HeaderTemplate != null)
            {
                var header = new GridModuleSection();
                HeaderTemplate.InstantiateIn(header);
                Controls.AddAt(0, header);
            }

            _placeholder = new BootstrapGridModulePlaceholder();
            _placeholder.Provider = typeof(UmbracoTreeModuleProvider).GetShortAssemblyName();

            if (!string.IsNullOrEmpty(ItemPath))
            {
                string itemPath;
                if (ItemPath == "§SiteRoot")
                    itemPath = CmsService.Instance.SitePath;
                else if (ItemPath.StartsWith("§"))
                    itemPath = CmsService.Instance.GetSystemPath(ItemPath.TrimStart('§'));
                else
                    itemPath = ItemPath;
                if (!string.IsNullOrEmpty(itemPath))
                    _placeholder.ReferenceId = CmsService.Instance.GetItem<Entity>(itemPath).Id.ToString();
            }
            else
                _placeholder.ReferenceId = CmsService.Instance.GetItem<Entity>().Id.ToString();
            _placeholder.Key = Key;
            Controls.Add(_placeholder);

            if (FooterTemplate != null)
            {
                var footer = new GridModuleSection();
                FooterTemplate.InstantiateIn(footer);
                Controls.Add(footer);
            }

            this.Visible = _placeholder.Visible;
        }