Hi all,
I know this topic is nothing complex, but the most strange this can look, I receive a lot of question and hits about how to Hide Lists from Browser, well I have a post already talking about this topic but was with SharePoint Designer 2007.
Now I want to make a update on how we can achieve this using the new tools and services from SharePoint 2010, there are multiple ways to make this update but I will explain using Microsoft SharePoint Designer 2010 and ECMAScript.
You can download Microsoft SharePoint Designer 2010 is free and is a excellent tool for administration and customization of your SharePoint Sites.
For this example we need to select the List or document Library to Hide, in this case I choose “Form Templates” open the SharePoint Designer 2010 and select the SharePoint site where the List/Document Library are.
On the Left side of your window you will see the option “Lists and Libraries” select the Document Library “Forms Templates” and right click selecting “List Settings”.
In the List Settings of the Library “Forms Templates” you will have a option in “General Settings” check option “Hide from Browser”

Ok, done is updated and is not visible on the browser.

First we need to add the HTML Form Web Part, edit WebPart and select the option “Source Editor” and add the following script:
<script type="text/javascript">
function GetSiteTitle() {
var clientContext = new SP.ClientContext.get_current();
var oWebsite = clientContext.get_web();
targetList = oWebsite.get_lists().getByTitle('Form Templates');
targetList.set_hidden(true);
targetList.update();
clientContext.load(targetList);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded() {
var listInfo = '';
listInfo += 'Is List Hidden: ' + targetList.get_hidden() + '\n';
alert(listInfo);
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
</script>
<input id="Button1" type="button" value="Hide List" onclick="GetSiteTitle()" />
When we click on the button “Hide List” the script will update the List and Hide from Browser and will return his current state.
Well, like I say before we have a lot of services and different ways to do the same thing, the most difficult is to know what I will use….
Cheers,

I know this topic is nothing complex, but the most strange this can look, I receive a lot of question and hits about how to Hide Lists from Browser, well I have a post already talking about this topic but was with SharePoint Designer 2007.
Now I want to make a update on how we can achieve this using the new tools and services from SharePoint 2010, there are multiple ways to make this update but I will explain using Microsoft SharePoint Designer 2010 and ECMAScript.
You can download Microsoft SharePoint Designer 2010 is free and is a excellent tool for administration and customization of your SharePoint Sites.
For this example we need to select the List or document Library to Hide, in this case I choose “Form Templates” open the SharePoint Designer 2010 and select the SharePoint site where the List/Document Library are.
On the Left side of your window you will see the option “Lists and Libraries” select the Document Library “Forms Templates” and right click selecting “List Settings”.
![]() | ![]() |
In the List Settings of the Library “Forms Templates” you will have a option in “General Settings” check option “Hide from Browser”

Ok, done is updated and is not visible on the browser.

Update List to Hide from Browser Using ECMAScript
To use this option you will need to be Shure you are using the Support file “SP.js” there is the Client Object Model for the ECMAScript API.First we need to add the HTML Form Web Part, edit WebPart and select the option “Source Editor” and add the following script:
<script type="text/javascript">
function GetSiteTitle() {
var clientContext = new SP.ClientContext.get_current();
var oWebsite = clientContext.get_web();
targetList = oWebsite.get_lists().getByTitle('Form Templates');
targetList.set_hidden(true);
targetList.update();
clientContext.load(targetList);
clientContext.executeQueryAsync(Function.createDelegate(this, this.onQuerySucceeded), Function.createDelegate(this, this.onQueryFailed));
}
function onQuerySucceeded() {
var listInfo = '';
listInfo += 'Is List Hidden: ' + targetList.get_hidden() + '\n';
alert(listInfo);
}
function onQueryFailed(sender, args) {
alert('Request failed. ' + args.get_message() + '\n' + args.get_stackTrace());
}
</script>
<input id="Button1" type="button" value="Hide List" onclick="GetSiteTitle()" />
When we click on the button “Hide List” the script will update the List and Hide from Browser and will return his current state.
Here is the result….
Well, like I say before we have a lot of services and different ways to do the same thing, the most difficult is to know what I will use….
Cheers,

1 comment:
Hi, this is a great solution, thanks.
But is there a way to get the list Title automatically?
Post a Comment