Forum Discussion
Webpart To view all documents of a user in MySite
- Sep 04, 2018
The simplest approach would be to navigate to your MySite, bring up the news feed page and edit the through the user interface. You'll see the web part zones which you can add the web part to. The page which has the news feed is a common page which is provided by the MySite host, therefore you can edit it in one place and all users will see search results which are contextual to them (See my screenshot).
I am using SharePoint 2013.
Regarding the definition of the document is to get the documents if that user has last modified the document. Not required to fetch if it's modified in the version history.
Thank you for the clarification. I'm a massive fan of search, especially for these types of requirements. You just need to remember that you'll need to wait for search to crawl the content before it appears.
On your page, you can add (assuming you've got SP2013 Enterprise) a Content Search web part (This can be found in your web part toolbox, under the Content Rollup category), or a Search Results web part (found under the Search Category once you have activated the Search Server Web Parts Site Collection Feature).
Edit your chosen web part and select "Change Query".
As you want to display content from anywhere within SharePoint, you can remove the path query, unless you're indexing data sources from outside of SharePoint as well.
Change you query to look like this:
(IsDocument:"True") EditorOWSUSER:{User.Name}
IsDocument:"True" will remove list items from your results and only show documents (this includes aspx pages)
EditorOWSUSER:{User.Name} will match the modified by field to the user who runs the query (the logged in user)
If you want to filter your query down even more you could add the following to specify file types:
(FileExtension:doc OR FileExtension:docx OR FileExtension:xls OR FileExtension:xlsx OR FileExtension:ppt OR FileExtension:pptx OR FileExtension:pdf)
As long as the user has permissions to the content source, they will see their documents in the results.
- Anisha AshokanSep 04, 2018Copper Contributor
Thank you for your response.
This looks great.
How can I implement the same to appear in every users MySite page so that each user can see there documents in their mysite?
- Matt WestonSep 04, 2018Iron Contributor
The simplest approach would be to navigate to your MySite, bring up the news feed page and edit the through the user interface. You'll see the web part zones which you can add the web part to. The page which has the news feed is a common page which is provided by the MySite host, therefore you can edit it in one place and all users will see search results which are contextual to them (See my screenshot).
- Anisha AshokanSep 04, 2018Copper Contributor
Hi ,
I dont see an option to edit page in the My site news feed page to add the webparts. Can you please help me as to where this option would be present.
Please see my screenshot.
Thanks