How to programmatically create a tab (page) using a template
Add an Answer
Your question has been submitted and is awaiting moderation.
Thank you for reporting this content, moderators have been notified of your submission.
Hi,
I am developing a module and have the requirement to programmatically create each new user a new tab (page) upon registration. My website already has a template for this user page and I can manually (i.e. as an admin through the ribbon bar) create a new tab from the template without any problems.
So far I am able to programmatically create a blank tab (page) for each new user dynamically, but I cannot figure out how to apply my template to the new tab. I feel like this should be as easy as setting a "tab.TemplateSrc" property as can be done for the tab skin with "tab.SkinSrc".
Thanks in advance for any help that can be offered.
If it helps, I am currently creating my new tab with the following code (C#):
//Create tab
TabController controller = new TabController();
TabInfo newTab = new TabInfo();
newTab.PortalID = PortalId;
newTab.TabName = "my tab name";
newTab.Title = "my tab title";
newTab.Description = "my tab description";
newTab.KeyWords = "my tab keywords";
newTab.IsDeleted = false;
newTab.IsSuperTab = false;
newTab.IsVisible = true;
newTab.DisableLink = false;
newTab.IconFile = null;
newTab.Url = null;
newTab.ParentId = 1;
int newtabId = controller.AddTab(newTab);
//Then set tab permission etc
...