I'm not very experienced with creating packages but I was wondering if it is possible to create files/masterpages with the use of a usercontrol(loaded after installation of a package).
I've created a usercontrol wich writes a file to the filesystem, which is running fine when not used as a package. When I load the usercontrol after installation of the package, nothing happens. So, I'm wondering if it'sis possible and if so, what am I missing and where can I find more information about fireing events in the usercontrol after package installation.
public partial class MyUserControl : System.Web.UI.UserControl { protected void Page_Load() { if (!IsPostBack) { Template mytemplate = Template.MakeNew("myNewTemplateName", User.GetUser(0)); /* This is the root admin user */ } }
You can then use the Template members to add your masterpage code. See the Umbraco API documentation for full details (namespace umbraco.cms.businesslogic.template).
No worries - it's cause the templates are also stored in the DB, creating them on the filesystem isn't enough - Umbraco doesn't implement a FileSystemWatcher on the ~/masterpages folder.
Create masterpage with package
I'm not very experienced with creating packages but I was wondering if it is possible to create files/masterpages with the use of a usercontrol(loaded after installation of a package).
I've created a usercontrol wich writes a file to the filesystem, which is running fine when not used as a package. When I load the usercontrol after installation of the package, nothing happens. So, I'm wondering if it'sis possible and if so, what am I missing and where can I find more information about fireing events in the usercontrol after package installation.
Hi Folkert,
Try this:
You can then use the Template members to add your masterpage code. See the Umbraco API documentation for full details (namespace umbraco.cms.businesslogic.template).
HTH,
Benjamin
Thanx, I didn't know I had to use the api.
Hey Folkert,
No worries - it's cause the templates are also stored in the DB, creating them on the filesystem isn't enough - Umbraco doesn't implement a FileSystemWatcher on the ~/masterpages folder.
Best,
Benjamin
is working on a reply...