Templates import/export
Hi
We are quite far into the development and now we are facing the issue of moving themplates between development, testing and staging servers.
Any tools or samples that might be usefull so we could accomplish that?
Kiril
Hello Kiril,
Would you elaborate a little bit more on the issues you face? Sitefinity deployment scenario should be the standard ASP.NET procedure, and you shouldn't have any problems deploying your website.
We look forward to receiving further information from you, so that we can efficiently help you solve your problem.
Kind regards,
Hristo Borisov
the Telerik team
Hi Hristo
Well we have 3 servers with Sitefinity - Development, Test, Production
The process is the next one:
- Developers are developing new features (modules + widgets + templates) on Dev server
- When some of the features is ready for testing it is deployed to Test server where QA and Customer is testing it.
- When tested the features that passed are moved to Production.
We can move Modules (DLL), Widgets (DLL + ASCX) + Config just fine, but we don't have any way to move templates that are created in Sitefinity.
So the question is
How to export template from Sitefinity installation and then Import that template to another installation?
//Kiril
Hi Kiril,
The only way you can currently export templates is to develop them as master pages in the very first time, and then move and register the templates in your project. The problem is that we currently store the templates inside the database and we haven't yet implemented an easy way to move them across projects. We plan to develop much easier synchronization among testing and production environments, however I cannot bind to any specific date for now.
Excuse us for the inconvenience and please let me know whether there is anything else you would like to share with us in order to improve our current roadmap.
Greetings,
Hristo Borisov
the Telerik team
By developing templates as Master pages we are then limiting the end users to use Layout editor to modify them later. So this is not really acceptable.
//Kiril
Is there an option to create a template with code by using the fluent (or some other parts of) api ?
Hi Lasse and Kiril,
You can use the bellow code to create page templates based on master pages:
PageManager manager = PageManager.GetManager();
var t = manager.GetTemplates().First();
Guid id = Guid.NewGuid();
PageTemplate pageTemplate = manager.CreateTemplate(id);
pageTemplate.Name =
"MyPageTemplate"
;
pageTemplate.Title =
"My Page template"
;
pageTemplate.Category = t.Category;
pageTemplate.MasterPage =
"~/App_Master/MyMasterPage.Master"
;
manager.SaveChanges();
Radoslav,
I have a Small Business Edition here. I have used the Template builder to create a template and now I am adding it into the project but all I can see is the Content Placeholders and that's all. Also, the Template Builder would crush everytime I tried to upload my own image. I was unable to upload any images, no matter the format. How do I add a template without the Template Importer and have all the colours that I have chosen be remembered?
Many thanks
Andrei
Ok, I figured out that those templates can only be added properly through the Template Importer. How do I register the Template Importer is teh next question.
Hello Andrei,
The template importer is registered as any other Sitefinity module. You need to regustered in the application modules section of the SystemConfig. You need to take the template importer project from the SDK, build it against the version of your Sitefinity project, and add the dll to your project. Then register it as if you are registering a custom module.
Regards,
Radoslav Georgiev
the Telerik team
Radoslav,
1 - I have extracted it from the SDK,
2 - I have imported it as another project in my solution.
3 - I have added it as a reference,
4 - I have built teh solution and that adds the TemplateImporter.dll to the WebApp bin,
Now what I need to know is the exact steps of:
1 - Where do I go and what do I type in? A screen-shot would be fantastic.
Many thanks,
Andrei