Friday, April 18, 2014

SharePoint 2013/2010 - Remove Columns Name from Group View

 To remove the column name from group view and retaining the collapse and expand option,copy and paste the below javascript in the page using content editor or script editor.

JavaScript (SharePoint 2013/SharePoint 2010):
<script type="text/javascript" language="javascript">
        _spBodyOnLoadFunctionNames.push("HideHeaders");
        function HideHeaders() {
            var elements = getElementsByClassName(document, "td", "ms-gb");
            var elem;
            for (var i = 0; i < elements.length; i++) {
                elem = elements[i];
                elem.childNodes[0].childNodes[1].nodeValue = "";
                elem.childNodes[1].nodeValue = elem.childNodes[1].nodeValue.replace(':', '');
            }
            elements = getElementsByClassName(document, "td", "ms-gb2");
            for (var i = 0; i < elements.length; i++) {
                elem = elements[i];
                elem.childNodes[1].childNodes[1].nodeValue = "";                elem.childNodes[2].nodeValue = elem.childNodes[2].nodeValue.replace(':', '');
            }
        }
        function getElementsByClassName(oElm, strTagName, strClassName) {
            var arrElements = (strTagName == "*" && oElm.all) ? oElm.all : oElm.getElementsByTagName(strTagName);
            var arrReturnElements = new Array();
            strClassName = strClassName.replace(/\-/g, "\\-");
            var oRegExp = new RegExp("(^|\\s)" + strClassName + "(\\s|$)");
            var oElement;
            for (var i = 0; i < arrElements.length; i++) {
                oElement = arrElements[i];
                if (oRegExp.test(oElement.className)) {
                    arrReturnElements.push(oElement);
                }
            }
            return (arrReturnElements)
        }
    </script>

Thanks to Source Article: http://amitphule.blogspot.com/2011/10/hiding-group-headers-from-sharepoint.html  

Happy Browsing!
Relax..

Wednesday, April 16, 2014

SharePoint  - Remove Columns Filter from List view

In order to remove the filter option from the list view and retain he sort, 
  1. Open the list view in the SharePoint Designer.
  2. Search for the inside   or column name that you want to hide filter option. The columns can be initially seen like this -
  3. Add the tags LinkToItem="TRUE" Filterable="FALSE" FilterDisableMessage="No filter available " tot the field names to hide the filter. After adding the tag looks like this -  
This will hide the column filter  and retains the sorting option in the list View. To take off the sorting , add Sortable="FALSE". 



Happy Browsing!
Relax..

Saturday, April 5, 2014

SharePoint 2013 - Image Slider from Content Query webpart with no coding

5 easy steps to create image slider from content query webpart with no coding!

I was looking for the image slider that can configured easily and effective with using OTB feature and I got different methods but some where I felt this can be made independent. Hence I used the blog from this article and image slider from basic Slider site and I merged with Content query webpart to get easy to use image slider.

Now to start in details

  1. Configure the content type as shown in this article.  ( this is used to order images and filter images) 
  2.  Create a picture library in your site and upload your images of same size. Now edit properties of the images, select the Slider Content Type (if you configure from step 1) then enter title, comments, url, sort order, start and end dates  etc for the images. This will be used to determine which image to be shown in the slider and in which order. 
  3.  Upload these files to any document library or style library or with your custom master page. 
  4.  Now, on the page where the image slider to be displayed, add a content query webpart and   open its property by edit mode. In the query part -Select the picture library you created as image source and in the presentation - select the newly configure content type and filter order. You can check this article for the details). After this you can now see the images lined up on you page. 
  5.  Now add a content editor webpart and set the source to slider.html from the document library where you uploaded the attached files.

Script files to Download 

PS: You can have different sliding styles with slider1.html . I have used images of size 950 * 240. So if you have different image size, you can change it in the style sheet and slider.html. Feel free to post me any query or comments. Thanks to both articles for providing such a beautiful articles.


Happy Browsing!
Relax..

Tuesday, April 1, 2014

SharePoint 2013/2010 : Export site url , request access email, site owner in to text file using PowerShell Script

 Run the below PS script using admin mode.

 #Pulls site url and request access email and writes out to output.txt

Get-SPSite -Limit ALL | Get-SPWeb -Limit ALL | Format-Table -Wrap -AutoSize -Property url,Owner,SecondaryContact,RequestAccessEmail | Out-String -Width 1000 | Out-File -FilePath SiteDetails.txt

#Pulls site url, owner and secondary owner and writes out to output.txt

Get-SPSite -Limit ALL | Format-Table -Wrap -AutoSize -Property url,Owner,SecondaryContact,RequestAccessEmail | Out-String -Width 1000 | Out-File -FilePath SiteDetails.txt

Article Source



Happy Browsing!
Relax..

SharePoint 2013/2010 : Export in to Excel - People and Group

Steps to export the people and group from your site
1. Get the list ID of the group whcih you want to export. To do this, go to People and group and select the group , then go to its setting. Copy the heightened portion from the URL as shown listedit.aspx?List=cf5tea84-e6c7-4be3-95f6-f55b8555bb11

2. Apped the copied List ID from above text to this URL:
 https://SiteCollectionURL/_vti_bin/owssvr.dll?Using=_layouts/query.iqy&List=cf5tae84-e6c7-4be3-95f6-f55b8555bb11

3. Copy and paste the URL formed into your explorer.  Bingo! your people list is in excel now!

(I'm not sure easy way to pull back the people entry back from excel after updating. Will add here once I get the solution.)




Happy Browsing!
Relax..

SharePoint - iFrame inside the page gives error while displaying the webpart page as source the page (cross domain), try this

 


Add this tag in the master page and you are done!

Text:
WebPartPages:AllowFraming ID="AllowFraming1" runat="server"



Happy Browsing!
Relax..

Apply SharePoint 2013 Theme to SiteCollection and its sub site using PowerShell Script


//Add the snapin for the power shell
Add-PSSnapin "microsoft.sharepoint.powershell"



//Set the site collection URL where the theme has to be applied
$url = "Site Collection URL"
$web = Get-SPWeb $URL

//Select the pallet color file,  if you do not have create one from this link.
$file = $web.GetFile($web.ServerRelativeUrl + "/_catalogs/theme/15/MyTheme01.spcolor")

$theme = [Microsoft.SharePoint.Utilities.SPTheme]::Open("MyTheme", $file)
$theme.ApplyTo($web,$true)
$site = Get-SPSite -Identity $url
Write-Host "RootWeb Theme: " + $site.RootWeb.ThemedCssFolderUrl
foreach ($web in $site.AllWebs) {
Write-Host "Web Title: " $web.Title
$web.AllowUnsafeUpdates=$true;
  Write-Host "Web Theme CSS: " $web.ThemeCssUrl
Write-Host "Web Theme: " $web.ThemedCssFolderUrl
$web.ThemedCssFolderUrl = $site.RootWeb.ThemedCssFolderUrl
Write-Host "Web Theme: " $web.ThemedCssFolderUrl
$web.Update()
$web.AllowUnsafeUpdates=$false;
$web.Dispose()
}
$site.Dispose();


PS: The above code is tested in my development server and it runs perfect for SharePoint 2013 and its the risk of the users to run the code in their environment. So run at your own risk! :)

Happy Browsing!
Relax..

SharePoint 2010 Custom Error Page using HTML


Steps to set the custom HTML error page for the SharePoint 2010

1. Prepare your HTML error message page/file and place it in the hive folder ( I'm using a sub folder here 14/CustomError) in the web front end server
2. Open the PowerShell in the administator mode and run the below command.(in all the web front end server)
Set-SPCustomLayoutsPage -Identity Error -RelativePath /_layouts/14/CustomError/error.html -WebApplication  http://sharepointsitecollectionurl


For see the error (Enabling Error Details)
Web.Config >> Enable stack trace ( true) and custom error mode = Off


And this script will not run on the SharePoint 2013 as the error pages are given directly in the Site Collection pages library.

PS: The above code is tested in my development server and it runs perfect for SharePoint 2010 and its the risk of the users to run the code in their environment. So run at your own risk!

More on this http://technet.microsoft.com/en-us/library/ff607768.aspx

Happy Browsing!
Relax..

 Rotating Banner or Slideshow -Free Javascript for Standalone page

A easy and free approach for the rotating banner or images or div that can be used to decorate the home pages of your website.  It has been tested and works in latest versions of all browsers.

For the code, please click here.

Please see this post for free sample and code: http://blog.crondesign.com/2012/01/free-javascript-for-rotating-website.html 

Happy Browsing!
Relax..

SharePoint 2013 - Hide Root Node Link in Global Navigation using CSS

To hide the root node in the global navigation, simply add this style in your content editor or in your main style sheet and its ready to go!
Style Code


.ms-core-listMenu-horizontalBox LI.static > A {
    DISPLAY: none !important
}
.ms-core-listMenu-horizontalBox LI.static > UL A {
    DISPLAY: block !important
}

Before

After 



Happy Browsing!
Relax..

SharePoint : Tabbed Menu using Page Layout

A beautiful article to show the page layout that is fully compatible with  SharePoint 2013 . Simply upload it to the master page gallery, and you're good to go.

Example :
Source: https://sharepointtabs.codeplex.com

Happy Browsing!
Relax..