I created my own list on a SharePoint site and created a Visual Studio 2008 project using the SharePoint Solution Generator. I can pack this as a function and install it. It works fine on my server.
After checking this, I was able to add a special main page to the function that was deployed in the _catalogs / masterpage folder. Here it is:
<Elements Id="2196306F-3F37-40b5-99CF-42E89B93888A" xmlns="http://schemas.microsoft.com/sharepoint/">
<Module Name="DefaultMasterPage" Url="_catalogs/masterpage" RootWebOnly="FALSE">
<File Url="gcbranding.master" Type="GhostableInLibrary" IgnoreIfAlreadyExists="TRUE" />
</Module>
</Elements>
Now that I have a custom homepage on my site, I would like this to be used to create new elements. But I do not want to install the wizard from SharePoint Designer.
Returning to the generated solution, it has NewForm.aspx, etc. with a list scheme. Like me...
- Customize the form displayed for new items and redirect it to the thankyou.aspx page instead of displaying all list items?
- Correctly set the URL of the main page?
I got lost at point 1. Do I need to create a custom website and embed it in NewForm.aspx?
At point 2, I made some progress, but ran into a problem. If I installed a wizard like this in my NewForm.aspx ...
MasterPageFile="~/masterurl/gcmaster.master"
It will install OK, but when I get to the site, I get an error because ~ is not allowed in the url. If I use _catalogs / masterpage in the directive, it will not find the master, because the URL is relative. Only this code seems to work:
MasterPageFile="../../_catalogs/masterpage/gcmaster.master"
What is the best way to customize the master page file in SharePoint when deploying a custom feature / solution?