Wednesday, 14 March 2018

Content Query Webpart

Create Custom XSLT template  example

 <xsl:template name="RecentUploads" match="Row[@Style='RecentUploads']" mode="itemstyle">
        <xsl:variable name="SafeLinkUrl">
            <xsl:call-template name="OuterTemplate.GetSafeLink">
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="SafeImageUrl">
            <xsl:call-template name="OuterTemplate.GetSafeStaticUrl">
                <xsl:with-param name="UrlColumnName" select="'ImageUrl'"/>
            </xsl:call-template>
        </xsl:variable>
        <xsl:variable name="DisplayTitle">
            <xsl:call-template name="OuterTemplate.GetTitle">
                <xsl:with-param name="Title" select="@Title"/>
                <xsl:with-param name="UrlColumnName" select="'LinkUrl'"/>
            </xsl:call-template>
        </xsl:variable>
       
        <div style="border-top:1px solid #ccc;padding:1% 0% 2% 0%;">
        <xsl:variable name="PointofContact" select="@PointofContact"></xsl:variable>
        <xsl:variable name="Linktosource" select="@Linktosource"></xsl:variable>
        <div class="divTopRow">
 
   
    <span style="font-weight:bold"> <xsl:value-of select="$DisplayTitle"/></span> <span> by </span><span style="font-weight:bold"> <xsl:value-of select="@PointofContact" disable-output-escaping="yes" /></span>
        </div>
        <div style="padding-top:1%;text-align:justify">
        <xsl:if test="string-length($SafeImageUrl) != 0">
        <div class="image-area-left contactlist-image-left">
         <img style="height:60px;width:60px" src="{$SafeImageUrl}" title="{@ImageUrlAltText}"/>
        </div>
      </xsl:if>
      <div style="min-height:61px">
      <xsl:value-of select="@Description"  disable-output-escaping="yes" />
      </div>
     
        </div>

        </div>
       
     
    </xsl:template>
---------------------------------------------------------------------

Apply color to Webpart title in sharepoint


<style>
#WebPartTitleWPQ7
{
background-color:#00417C !important;
}
#WebPartTitleWPQ7 h2
{
color:white !important;
font-weight:bold !important;
padding:8px 0px 8px 4px !important;
font-size: 14px;
}
</style>

Monday, 5 March 2018

SharePoint 2013 Lookup Column Width increase and change the backgorund color,apply color to save and cancel of list forms

SharePoint 2013 Lookup Column Width increase

Try this code in content editor webpart;-

<style>
.ms-formtable table.ms-long {
    width:600px !important;
}
 
.ms-formtable table.ms-long .ms-input>select {
    width:300px !important;
}
</style>

Change the backgorund color,apply color to save and cancel buttonof sharepoint list forms

.ms-formbody {background-color:#f1f1f1 !important} input[value=Save],input[value=OK]
{
background-color:#00417C;
font-size:14px;
color:white;
width:110px;
}
input[value=Save]:hover,input[value=OK]:hover
{
background-color: #00417C !important
}
input[value=Cancel]
{
background-color:#599bb3;
font-size:14px;
color:white;width:110px;
}
input[value=Cancel]:hover
{
background-color: #599bb3 !important
}