Skip to content

Instantly share code, notes, and snippets.

<xsl:call-template name="string(@status)"/>
<xsl:if test="contains(@status,'test')">
<xsl:call-template name="test"/>
</xsl:if>
<xsl:if test="contains(@status,'test2')">
<xsl:call-template name="test2"/>
</xsl:if>
<xsl:template name="test">
<xsl:param name="Pos" select="position()"/>
<h1>test</h1>
<SharePoint:FormField runat="server" id="testfield1{$Pos}" ControlMode="Edit" FieldName="Title" __designer:bind="{ddwrt:DataBind('u',concat('testfield',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}"/>
</xsl:template>
<xsl:template name="test2">
<xsl:param name="Pos" select="position()"/>
<h1>test</h1>
<SharePoint:FormField runat="server" id="testfield2{$Pos}" ControlMode="Display" FieldName="Title" __designer:bind="{ddwrt:DataBind('u',concat('testfield',$Pos),'Value','ValueChanged','ID',ddwrt:EscapeDelims(string(@ID)),'@Title')}"/>
@PiotrFerenc
PiotrFerenc / colored-status-view.xsl
Created July 11, 2018 14:07
colored Sharepoint status column
<xsl:stylesheet xmlns:x="http://www.w3.org/2001/XMLSchema" xmlns:d="http://schemas.microsoft.com/sharepoint/dsp" version="1.0" exclude-result-prefixes="xsl msxsl ddwrt" xmlns:ddwrt="http://schemas.microsoft.com/WebParts/v2/DataView/runtime" xmlns:asp="http://schemas.microsoft.com/ASPNET/20" xmlns:__designer="http://schemas.microsoft.com/WebParts/v2/DataView/designer" xmlns:xsl="http://www.w3.org/1999/XSL/Transform" xmlns:msxsl="urn:schemas-microsoft-com:xslt" xmlns:SharePoint="Microsoft.SharePoint.WebControls" xmlns:ddwrt2="urn:frontpage:internal" xmlns:o="urn:schemas-microsoft-com:office:office">
<xsl:include href="/_layouts/xsl/main.xsl"/>
<xsl:include href="/_layouts/xsl/internal.xsl"/>
<xsl:template name="FieldRef_body.Status" match="FieldRef[@Name='Status']" mode="body">
<xsl:param name="thisNode" select="."/>
<xsl:choose>
<xsl:when test="$thisNode/@*[name()=current()/@Name] = 'Completed'">
<img src="/_layouts/images/IMNON.png" alt="Status: {$thisNode/@Status}"/>
</xsl:when>
@PiotrFerenc
PiotrFerenc / SPOUpload-Files.ps1
Created July 11, 2018 13:25
Files Sharepoint Upload
Add-Type -Path "C:\Microsoft.SharePoint.Client.dll"
Add-Type -Path "C:\Microsoft.SharePoint.Client.Runtime.dll"
Function Ensure-Folder()
{
Param(
[Parameter(Mandatory=$True)]
[Microsoft.SharePoint.Client.Web]$Web,
@PiotrFerenc
PiotrFerenc / Get-MsolUsers.ps1
Created July 11, 2018 13:09
PowerShell AzureAD Groups Members
$User = "[email protected]"
$PWord = ConvertTo-SecureString -String "tajnehaslo" -AsPlainText -Force
$Credential = New-Object -TypeName "System.Management.Automation.PSCredential" -ArgumentList $User, $PWord
#$UserCredential = Get-Credential
Connect-MsolService -Credential $Credential
$Groups = Get-MsolGroup -All
foreach ($Group in $Groups)
{