New answers tagged feature-activation
The best practice is to Create a Visual Studio Solution. Then add your page layouts and other styling files. Create a feature receiver Use that to set the Page or create new page using the custom layout etc. For existing site, you can deploy the solution and then use PowerShell to activate it on all the sites.
Once the feature is activated we access the default content type in the “Demo List” list which is “Item” , we save it’s default forms urls as custom web properties so we can recover them when we need to do so. Then we access once again the “Item” content type to define its forms url’s using the customs forms urls this time. For more Details check URL" ...
For accessing layout folder (which is in the file system) you should use a different approach. For 2013 http://msdn.microsoft.com/en-us/library/microsoft.sharepoint.utilities.sputility.getversionedgenericsetuppath.aspx For 2010 SPUtility.GetGenericSetupPath
Top 50 recent answers are included