Skip to content

Instantly share code, notes, and snippets.

View vtml's full-sized avatar

Vincent Lui vtml

View GitHub Profile
@vtml
vtml / enhanced-ce-import.ps1
Last active March 10, 2021 11:18
Sitecore Creative Exchange Import SPE script
<#
.SYNOPSIS
Performs a Sitecore Creative Exchange Import from the files on disk
.DESCRIPTION
This script utilises the Sitecore Creative Exchange to import front end static assets into the media library. This gives the front end development team full flexibility to use the tools
they are needed to produce the final output. This is a Sitecore Powershell Extension script that should be stored where all the other Script Libraries are placed in Sitecore.
@vtml
vtml / FrontEndBuild.ps1
Last active December 8, 2019 23:14
Sample Front End Build which triggers Creative Exchange Import
<#
.SYNOPSIS
This script runs the Front End Build, with an option to trigger Creative Exchange Import to the Web Site
.DESCRIPTION
This script runs the Front End Build, with an option to trigger Creative Exchange Import process to the specified SXA web site. This can be used on both developer PC's, mainly a back end developer as a back end developer do not neccessarily require the most up to date front end build assets at all times.
.PARAMETER SitecoreWebSiteCreativeExchangeFolderPath
@vtml
vtml / Project.ACME.Website.ViewsPrecompilation.config
Created December 5, 2019 11:16
LocalDeveloper Environment Based Configuration for Views Precompilation
<?xml version="1.0"?>
<configuration xmlns:patch="http://www.sitecore.net/xmlconfig/" xmlns:localenv="http://www.sitecore.net/xmlconfig/localenv/" xmlns:role="http://www.sitecore.net/xmlconfig/role/">
<sitecore role:require="Standalone or ContentDelivery or ContentManagement">
<settings localenv:require="LocalDeveloper">
<!-- MVC: Flag for controlling whether Razor View Engine will look at physical view last modified dates
when determining to use a view file from a pre-compiled assembly or from the file system.
Default: "false"
-->
<setting name="Mvc.UsePhysicalViewsIfNewer" value="true" />
</settings>
@vtml
vtml / Sitecore-ImageResizing-EdgeWorker
Last active April 30, 2020 02:40
CloudFlare Image Resizing Edge Worker for Sitecore
addEventListener('fetch', event => {
event.respondWith(handleRequest(event.request))
})
/**
* Fetch and log a request
* @param {Request} request
*/
async function handleRequest(request) {
// Parse request URL to get access to query string
@vtml
vtml / choco-packages-for-sitecore-docker-build.ps1
Last active March 10, 2021 09:35
A list of Chocolatey packages required to install on a Windows VM to build Sitecore Docker Containers
Set-ExecutionPolicy RemoteSigned -Force; Set-ExecutionPolicy Unrestricted -Force; [System.Net.ServicePointManager]::SecurityProtocol = [System.Net.ServicePointManager]::SecurityProtocol -bor 3072; iex ((New-Object System.Net.WebClient).DownloadString('https://chocolatey.org/install.ps1'))
choco install dotnetcore -y
choco install dotnetcore-sdk -y
choco install webdeploy -y
choco install dotnetfx -y
choco install netfx-4.8 -y
choco install powershell-core -y
choco install azure-cli -y
choco install git -y
choco install sourcetree -y
@vtml
vtml / Docker-compose
Last active February 14, 2021 22:23
Traefik 20H2
services:
traefik:
image: traefik:v${TRAEFIK_VERSION}-nanoserver-${NANOSERVER_VERSION}
build:
context: .
args:
NANOSERVER_VERSION: ${NANOSERVER_VERSION}
TRAEFIK_VERSION: '${TRAEFIK_VERSION}'
...
@vtml
vtml / Update workflow and state on content items.ps1
Last active May 5, 2021 05:17 — forked from marcduiker/Update workflow and state on content items.ps1
Sitecore Powershell script to update the workflow and state on content items which do not have a workflow set on them.
<#
.SYNOPSIS
Updates the Workflow and Workflow state fields of content items with the given $workflowID and $workflowStateID values.
.DESCRIPTION
This script can be used when existing content is not assigned to a workflow and workflow state while it should be.
This scenario usually occurs when a workflow is assigned to a template but there is already content created based on a previous version of that template (where the workflow was not yet assigned).
@vtml
vtml / ImportWizardFromCSV.ps1
Created May 5, 2021 07:42 — forked from michaellwest/ImportWizardFromCSV.ps1
Import content from a CSV using Sitecore PowerShell Extensions.
<#
.SYNOPSIS
Data Import Wizard provides a way to generate or update content from an external file.
.DESCRIPTION
The import file uses the properties "Name" and "Id" to help match existing items.
.NOTES
Requires Sitecore PowerShell Extensions 4.6 or newer.