Sometimes when working with SharePoint list views, you may want to be able to customize the view to include additional information or to have the list items link to a specific URL. This was the case with a recent project of mine. I wanted to be able to direct the user to a page that would log which articles from a list they were viewing. That way we could track which products were receiving more questions and train the sales reps accordingly.
I began by creating some custom views and setting some filter criteria on them. When you do this it creates an ASPX page under the list. You can view these pages using SharePoint Designer. When I viewed the page I could not find a discernible block of code that corresponded to the link that gets created on a list item so that you can view the details for that item.
Then I remembered the Convert to XSLT Data View option. If you right-click on a list view web part and selec this option it will convert the list view code into XSLT. It is much easier to find blocks of code this way. I used this to make the default URL in the list item links point to my page and then redirect the user to the list item.
One thing to be aware of is that if you switch to the XSLT Data View, you will no longer be able to modify the view from the browser. The only option available will be to change the name of the view. You can overcome this by opening the view in SharePoint Designer and right-clicking on the web part again and selecting Revert to SharePoint list view. This will remove any of the customizations that you made, though, but it will allow you to edit the view in the browser again.
I converted list to XSLT to view the data. and just like what you said, i couldn't edit it again through browser.
ReplyDeletewhat should i do to edit it through browser again without losing any customization i have made?
Thanks for the advice
I have yet to find a clean solution to this. In the past I have copied my code off and then reverted it back. Then switched it back to XSLT and added my changes back in.
ReplyDeleteNot a perfect solution but it works.
Michael