Problem:
When you create a site from Save Site As Template
functionality either using Visual Studio to modify the wsp or directly creating
a site from the Template. You don’t see any data in Web designer Galleries à Composed Looks
library. Normally this library should have data similar to following:
Reason: When you create a Site using the wsp that
was created by "Save Site as Template" functionality, it changes a XsltListViewWebPart
to ListViewWebPart in _layout\design\AllItems.aspx page.
Solution: To replace ListViewWebPart by XsltListViewWebPart.
Following picture is showing correct content of AllItems.aspx page (taken from a
working site that displays correctly data in Web designer Galleriesà Composed Looks).
Whereas following pictures shows incorrect ListViewWebPart is placed in AllItems.aspx (taken from a non working site that displays no data in Web designer Galleriesà Composed Looks.)
Step 1: Open the WebSite that shows correct data in a
SharePoint Designer instance. Navigate to All Filesà _catalogàdesignàAllItems.aspx page and open the file.
Step 2: Copy the section that has WebPartPages:XsltListViewWebPart
to a Notepad file lets name it Target.txt.
We will use this to create our own WebPartPages:XsltListViewWebPart tag and
will finally replace that to the AllItems.aspx page of the site that is not
working.
Step 3: Now open our site that has problem, using SharePoint
Designer. Navigate to All Filesà
_catalogàdesignàAllItems.aspx Page and
create a copy of this page so that if something goes wrong then you can always
restore it.
Step 4. Checkout the AllItems.aspx page. Locate the WebPartPages:ListViewWebPart
tag. Copy the whole tag to notepad file, lets name it Source.txt.
Step 5. We will use data (only some Guids) from Source.txt
and will replace those Guids at correct places in Target.txt. Finally we will
have our tag ready to be replaced in problematic AllItems.aspx file. Please refer following picture for data that has to be replaced in Target.txt from Source.txt.
Step 6. You will have to replace 1, 4, and 6 with View Name
value from Source.txt.
Step 7: You will have to replace 2 with ListName from
Source.txt.
Step 8: You will have to replace 3 with ListId from
Source.txt.
Step 9: Finally your content in Target.txt are changed something similar to the following:
Step 10: Now replace the content of Target.txt into WebPartPages:ListViewWebPart tag in AllItems.aspx of the site that is not displaying Composed Looks data.
Step 11: Save and check in the file and try browsing content of Composed Looks and you should see your data.
What is the value for number 5? I am getting a web part error for that code? Any advise? Thanks :)
ReplyDeleteHi There, Sorry I did not see your comments earlier. Please let me know if you are still facing this issue and I will help you out. Basic idea is that you have to get correct GUID from working to the one that have issues.
Delete