Velin Georgiev Blog

SharePoint server, recipes from the past

Content type with document link

<?xml version="1.0" encoding="utf-8"?>
<Elements xmlns="">
<!-- Parent ContentType: Document (0x0101) -->
<ContentType ID="0x010100F605427E752A4BAA862209C34B3F09C6"
Name="VA BaseDocument"
Group="Virtual Affairs Content Types"
Description="VA BaseDocument"
Version="0" >
<FieldRef ID="{43B20842-67DB-46E8-AF77-67A6D2411343}"
Name="Confidentiality" />
<DocumentTemplate TargetName="~Site/Documents/PurchaseOrder.dotx" />

Content Query Web Part parameter to XSL Stylesheet

I will add the web part title property just to demonstrate how this can be done. Open your custom content query web part .webpart file and under property "ParameterBindings" add your property so the code would look like:

<property name="ParameterBindings" type="string">
<ParameterBinding Name="WebPartTitle" Location="WPProperty(Title)"/>

... where the WPProperty(Title) ... Title is your property. Then go to the /Style Library/Custom Style Sheets/ContentQueryMain.xsl or wherever your ContentQueryMain.xsl is and after to other params add yours ...

<xsl:param name="WebPartTitle" />

... so now the value of the web part title property can be used in both (ContentQueryMain.xsl and ItemStyle.xsl) XSL files as example:

<xsl:value-of select="$WebPartTitle" />

One good reference for passing the CurrentPos in your ItemStyle.xsl here: Custom Date Formats in SharePoint XSL:

SharePoint Powershell Force Install solution with bin deployment

PS C:\Users\Administrator> Install-SPSolution -Identity contoso.wsp -Force -FullTrustBinDeployment -GACDeployment -WebApplication "contoso webapp"

Get list item versions computed data with CSOM

It will pull data only for computed the following fields: CheckInComment,Created,CreatedBy,ID,IsCurrentVersion,Length,Size,Url,VersionLabel

var id = new Guid(item["UniqueId"].ToString());
var file1 = clientContext.Web.GetFileById(id);

var versions = file1.Versions;

For advanced custom fields data you should use Lists.asmx service. See PnP for more info.