I am trying to change the hyperlink on the AllItems.aspx page to point to a custom upload page for my document library called CustomUpload.aspx.
Assuming I have two Document Libraries (lists). One called vsList, created in Visual Studio and deployed as part of a SharePoint solution and the other called sdList, created the usual way from the browser.
Here's what I've been able to successfully accomplish to date:
- Edit the AllItems.aspx page of the sdList in the web based editor. Customize the XsltListViewWebPart that contains the "Add new item" hyperlink by setting it's Toolbar Type to "Summary". Then, using SharePoint Designer (SPD), I click the "Add new item" hyperlink in the designer view and the little right arrow appears and allows me to edit the hyperlink options (i.e. set the value to my own custom URL).
- Copy and paste the XSL code from above into the AllItems.aspx file for the vsList doc library and make sure that the path to the url is correct since of course SharePoint can never find anything because of the crapfest of mapped and virtual directories that "is" SharePoint.
Option #1 isn't a real solution because it only works for doc libraries that are created directly via the web-based GUI editor in the SP portal. I need to have all of this defined in my list definition that I created in VS. As for option #2, the issue is pretty much the same. If I copy and paste the custom XSL into the AllItems.aspx page then it will be overwritten each time I redeploy my VS solution that contains my custom list definition. So really I need a solution that will allow me to define the custom URL in my VS list definition.
Here's what SHOULD work -but doesn't:
- Create a custom Xsl file with all the tweaks required to override the default "Add new item" link. Edit the XslLink property of the XsltListViewWebPart in the AllItems.aspx page for the sdList document library by using Site Action => Edit Page => Edit Web Part => Miscellaneous => XSL Link.
- Edit the Elements.xml file for the list definition by adding the necessary Module and File XML tags to point to the custom XSL file that would override the "Add new item" URL. No matter what I do it won't deploy when I add in the tags because it just can't find the custom XSL file.
I've tried putting the file in like 100 different places and it keeps trying to look for it in "Features[MY PROJECT NAME]_PrimaryFeature\CustomStyle.xsl". Where does it get the idea that I'm storing the file in that path/location? Even when I try to store the XSL file in the SharePoint mapped LAYOUTS/XSL directory or in the Style Library document library in the actual SharePoint site it still can't find it. It's just maddening. Paths, location, directory structure and XSL have become the biggest roadblocks for me in trying to get anything done in SharePoint.
Please help.