Thursday 15 May 2014

DateTime

<xsl:value-of select="ddwrt:FormatDateTime(string(ddwrt:Today()),1033,'dd')"/>

Displaying today’s date using XSL and SharePoint
 < xsl:value-of select="ddwrt:Today()">

FormatDate(string szDate, long lcid, long formatFlag) 
FormatDate(@Today, 1033, @No)

1  : 5/9/2007
3  : Wednesday, May 09, 2007
4  : 9:06 AM
5  : 5/9/2007 9:06 AM
7  : Wednesday, May 09, 2007 9:06 AM
12: 9:06:12 AM
13: 5/9/2007 9:06:12 AM
15: Wednesday, May 09, 2007 9:06:12 AM


 < xsl:value-of select="ddwrt:FormatDateTime(string(ddwrt:Today()), 1033,'yyyyMMdd')" > < /xsl:value-of > 


XsltListViewWebPart Date Format using DDWRT
 <xsl:value-of select="ddwrt:FormatDateTime(string(@Modified), 3081, ‘dd-MMM-yyyy’)" />

SPLocale.LCID property & Regional settings (SharePoint Server 2010)
 Australia: 3081
 Persian: 1065


Branding CSS and Javascript tricks

How To: Hide Left Side Navigation on Home Page
<style type="text/css">
 body #s4-leftpanel {display: none;
.s4-ca {margin-left: 0px;
 </style>

How To: Hide Recently Modified
<style type="text/css">
 .s4-recentchanges {display:none;}
</style>

How To: Change the “No Items” message in a discussion web part with jQuery
<script type="text/javascript">
 $(document).ready(function(){
 $("td .ms-vb:contains('There are no items to show in')").text('There are no active discussions');
  });
</script>

How To: Hiding “Add new item” and “There are no items to show…” in SharePoint
https://www.threewill.com/2013/12/hiding-add-new-item-and-there-are-no-items-to-show-in-sharepoint/

How To: How To Remove Extra Space Around the Web Part In SharePoint 2013
<style type="text/css">
 .ms-webpartPage-root {border-spacing: 0px !important;}
 .ms-webpartzone-cell {margin: 0px !important;}
</style>

How To: Hide a web part with zero rows
<script>
function HideWebPartWithZeroRows()
{
  var a = document.getElementsByTagName("TABLE")
  for (var i=0;i<a.length;i++)
  {
    if (a[i].summary=="Test List")
    {
      if (a[i].rows.length==1)
      {
        //hide all but the title bar
        //var x =  a[i].parentNode.parentNode.parentNode.parentNode.parentNode
        //hide the entire web part
        var x =  a[i].parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode.parentNode

        x.style.display="none";
      }
    }
  }
}
_spBodyOnLoadFunctionNames.push("HideWebPartWithZeroRows") 
</script>

How To: Remove link border from around image
<style>
   a img {border:none}
</style>
<a href="http://sharepoint.stackexchange.com">
   <img src="http://cdn.sstatic.net/sharepoint/img/logo.png">
</a>

OR via inline styles:


<a href="http://sharepoint.stackexchange.com">
   <img src="http://cdn.sstatic.net/sharepoint/img/logo.png" style="border:none;">

</a>