1

I have a Sharepoint Wiki Library and have created a series of views to show different aspects of my Library.

How can I display the list of all available views on one page?

I currently have to go to a single view (by knowing the URL or going through Library Settings) and change view from the dropdown list in the page header.

1

There are many ways you can do this

No Code Solution

  1. Create a page
  2. Add a content editor webpart
  3. Edit the content and add URL to the view using html a tags

Using Server Object Model

  1. Create a visual webpart
  2. Get the SPList object and use the SPViewCollection property

Using Client Object Model

  1. Add a content editor webpart
  2. Use below code

    clientContext = new SP.ClientContext.get_current();
    if (clientContext != undefined && clientContext != null) {
    var web = clientContext.get_web();
    var listCollection = web.get_lists();
    var list = listCollection.getByTitle("Wiki");
    var viewcollection = list.get_views();
    clientContext.load(viewcollection);
    clientContext.executeQueryAsync(Function.createDelegate(this, GetViews), Function.createDelegate(this, this.onQueryFailed));   
    

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.