XsltListViewWebPart with CrossList - sharepoint

i'm new to SharePoint, and i'm working with sharepoint 2010.
I'm trying to create a webpart on SPdesigner that holds a XsltListViewWebPart
which is linked to a custom library i created in the Site Collection.
I want to list all the documents related to current user from the all sites
under the site collection.
to do so i set the DataSourceMode from "List" to "CrossList"
but then the webpart doesn't show any document as seen in the image below
(its like there is a line but the data is not showing..)
Does any one know what the reason for this?
How can I fix it to work so the webpart will list all docs from all sites in collection?

First, is there any reason why you don't use the out of the box Relevant Documents Web Part?
I don't think the xslt List View Web Part works in crosslist mode. What you'll need to do is use a Data View Web Part.

Related

How to find out new pages / lists / listitems added to the intranet site?

Is it possible to find what new pages / lists / listitems have been added to the intranet site and generate a report on daily basis ?
We have to implement this on sharepoint 2010 and also on sharepoint 2013 websites.
We are using C#.NET.
I am aware that we can find newly created listitems by creating a listview and then sorting it by DATE as TODAY-2 where 2 is no. of days prior.
But, how can I implement same for all lists in the site?
I am doing research on the web analytics in sharepoint 2010, but this doesnot seem to serve my purpose.
Have you come across similar requirement?
I wrote you a small manual on how to create a separate ASPX-page in the _layouts folder. If something is unclear feel free to ask me in the comments of this answer.
I am assuming that you have already a solution set up for both versions SP2010 and SP2013.
Add a new ASPX-page (application-page) to the layouts mapped folder in your solution, lets name it "ViewNewContent.aspx".
In the codebehind in the page_load function, code something that loads all items that have creation date > some defined date and display them on the aspx page. Load the list using the GUID that you will pass as a Get-Parameter to the aspx-page (ViewNewContent.aspx?List={Some-GUID})
Now create a custom action that displays on all lists and redirects the user to the your page with the ListId added: ViewNewContent.aspx?List={ListId}
I hope this gives you a basic idea on how to do this.

Changing the source of a Sharepoint List View

Effectively I am looking to change the viewed Document Library within an exsisting List View Web Part from 'Document Library #1' to Document Library #2'. I want to do so without having to re-create the entire web part (e.g. settings & views) as I would have to do this multiple times.
Sharepoint version is 2007 and Sharepoint Designer is not avaliable.
Context: I am currently building a Sharepoint area which will consist of multiple ASPX pages all based off an original layout. This layout includes a List View web part that directly views a Document Library.
Each ASPX page has a Document Library attributed to it (e.g. Page1.aspx and DocLib1), which I wish to display within this List View web part.
Page1.aspx was setup just fine (effectively the original). When setting up Page2.aspx as a direct copy of the first, I am unable to change the List View from DocLib1 to DocLib2 as there seems no option to do so.
The list view web part isn't easily customizable unless you can edit the xml for the web part and change some guids. If you want to be able to change the source list through the browser you will need to use a different web part - the content query web part is an out of box option, though obviously that is quite different from the standard list view.
You may also be able to do something with with list templates - if you can use a custom template instead of the standard document library template, you may be able to alter AllItems.aspx to do what you need.

Navigating sharepoint with a treeview

I'm trying to replace the navigation on our sharepoint site with a treeview. It's a large site with up to 4 subsite leves in places. All I need it to do is
show a consistent structure from page to page
show only sites and pages
The default sharepoint treeview seems to do neither of these things (doesn't display items from the parent site, includes document libraries but not pages).
Does anyone have any idea how to achieve this? We're using the publishing site template throughout if that makes a difference.
I've tried binding the tree to the datasource the quick launch uses but I guess from the error message they expect differently named properties.
You cannot do it using the default property of sharepoint.
But I had also almost the same requirement. I did this task by the following way
Store all the links in an XML file.
Create a webpart for reading XML file and create menu
Open the masterpage using sharepoint designer and comment the lines which render the top navigation and place the new webpart there
Inherit this masterpage in its subsite.
For multi level quick launch the below link will help you
http://blogs.msdn.com/sharepoint/archive/2007/04/26/customizing-the-quick-launch-menu-adding-fly-out-menus-to-sharepoint-navigation.aspx
If you want more help, pls ask me, I can help you

Sharepoint - Showing calendar events in multiple calendars in diff't sub-sites

I am trying to show events from a calendar in the main site to a calendar in a sub-site of the main site (or vice-versa)...I can't alter any server files or use custom-built web parts...is there anyway to do this w/ OOTB moss 2007?
Altering Server files is a big no-no anyway, so that's good :-D. YOu could try using SharePoint designer to create a so-called aggregation webpart, pulling data from all sites in the site collection (which of course get security trimmed by sharepoint, so people see only what they are allowed to see).
YOu can create use a DataFormWebPart in SharePoint designer to build an aggregation webpart. This is still ootb, but allows you to configure the datasource: i.e. have the datasource query the entire site collection for calendar items, then display them in a list. Disdplay them in a "new" calendar will be a lot of work though.
There is no way to "copy" or deisgnate specific calendar items to be visible in specific other calendars, this will take custom code.
Not strictly OOTB MOSS 2007, but I recenlty wrote an article about syncing any list using a simple workflow. As a Calendar is just a list it works for that as well and it maintains the Calendar look and feel.
Check it out here, it works great and deals with attachments as well. As it is part of a workflow you can add your own logic easily, e.g. Only sync calendar events that have field 'x' set to 'y'.
I wanted to point out that RSSBus Web Part can handle a task like this with minimal code. This, although not ootb is quite simple and does not require use of SharePoint Designer.
<rsb:import lib="RSSBus.SpsOps"/>
<rsb:set attr="url" value="http://mysharepointsite/subSite/"/>
<rsb:set attr="list" value="Calendar"/>
<rsb:set attr="user" value="someuser"/>
<rsb:set attr="password" value="theirpassword"/>
<rsb:call op="spsListItems">
[[sp:name]]</br>
</rsb:call>
The code above can be placed within the RSSBus Web Part on the main site and through the use of "SpsOps" have access to all lists/items on all sites/subsites.
-S

I need to have more information (an image and description) about a site in Sharepoint 2007?

I have a website in Sharepoint 2007 (it is a publishing portal).
I want to create a site with more specific info than what it comes with Sharepoint.
You know, when you create a new site, the only info you can enter is title and URL.
I would need an image and a description.
The solution is not a custom list, because i need to have pages inside and other lists.
How can i extend this site list?
Write an application page or web part that creates the new site. Programmatically update it with what users enter in your custom form.
Creating the site
The SPWebCollection.Add() method creates the site from a site definition. Create a custom definition that includes the site columns, content types and lists required. These will then be created as part of the site.
Further customisations
This won't perform all customisations however - for the rest develop a feature receiver. On activation it will run any arbitrary code on your new site.
For example as you are using a publishing site, retrieve its default page with the DefaultPage property. This is an SPFile object which has an Item property that can be edited like any other SPListItem. Update the image field and description field for the item based on its content type. The page will then render these properties.
All of the above can be wrapped in an SPLongOperation for a nicer user experience.
There are other options as well, for example the SPWebProvisioningProvider. The two separate steps above of creating a site definition and activating a feature receiver could be tied into one with this.
There is more information on the above techniques (plus others) and their pros and cons in part 3 and part 4 of this series by Raymond Mitchell.

Resources