Skip to content

Instantly share code, notes, and snippets.

@leekelleher
leekelleher / ExternalLink.master
Created September 22, 2011 15:48
Umbraco template to redirect to an external URL, (set as a property on the current page/node).
@leekelleher
leekelleher / NavigationAToZ.xslt
Created November 24, 2011 11:22
XSLT snippet for generating an A to Z list for Umbraco content nodes.
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
exclude-result-prefixes="msxml umbraco.library">
@leekelleher
leekelleher / cakes.json
Created November 28, 2011 16:56
Example JSON dataset (for uComponents' JsonDropDown data-type)
[
{
"id": "0001",
"type": "donut",
"name": "Cake",
"ppu": 0.55,
"batters":
{
"batter":
[
@leekelleher
leekelleher / ArchiveNewsPages.cs
Created January 9, 2012 16:01
Example Umbraco /Base method to archive news pages if they are over 30 days. (Using uComponents' uQuery)
using uComponents.Core.uQueryExtensions;
using umbraco.presentation.umbracobase;
namespace Our.Umbraco
{
[RestExtension("examples")]
public class Examples
{
public static bool ArchiveNewsPages()
{
@leekelleher
leekelleher / SearchResults.xslt
Created February 21, 2012 21:26
Manipulate XSLTsearch
<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE xsl:stylesheet [
<!ENTITY nbsp "&#x00A0;">
]>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:msxml="urn:schemas-microsoft-com:xslt"
xmlns:umbraco.library="urn:umbraco.library"
xmlns:PS.XSLTsearch="urn:PS.XSLTsearch"
@leekelleher
leekelleher / backup-dev.bat
Created April 13, 2012 17:33
Personal batch script to quickly back-up my MSSQL database and wwwroot files, (typically for use with Umbraco).
:: ###### BACK-UP JOB ######
@ECHO OFF
:: Set the constants
SET BACKUP_DIR=C:\path\to\_backup
SET TEMP_DIR=%BACKUP_DIR%\TEMP
SET TODAY=%DATE:~6,4%%DATE:~3,2%%DATE:~0,2%
SET ARCHIVE_DIR=%BACKUP_DIR%\%TODAY%
SET WWWROOT_NAME="ProjectName"
SET WWWROOT_SOURCE=C:\path\to\wwwroot
@leekelleher
leekelleher / README.md
Created July 9, 2012 14:19
Upgrading to Umbraco 4.8 breaks support for uComponents

Upgrading to Umbraco 4.8 breaks support for uComponents

For more information about the issue, please read: http://j.mp/umb48-breaks-ucomponents

Steps to workaround the issue

  • Take a copy of the "Lucene.Net.dll"
  • Create a new folder inside your /bin folder called "legacy", then put "Lucene.Net.dll" inside the new /bin/legacy folder.
  • In the root of your website, open the Web.config file in your favourite text-editor.
@leekelleher
leekelleher / umbraco-package-ideas.md
Last active June 9, 2020 09:36
Umbraco Package Ideas
@leekelleher
leekelleher / Script-Umbraco-MSSQL.ps1
Created August 10, 2012 10:14
Powershell script to export an Umbraco MS-SQL database
[xml]$webconfig = Get-Content "web.config"
$conn = $webconfig.configuration.appSettings.SelectSingleNode("add[@key='umbracoDbDSN']").value
& 'C:\Program Files (x86)\Microsoft SQL Server\90\Tools\Publishing\1.4\SqlPubWiz.exe' script -C "$conn" umbracoDbDSN.sql
@leekelleher
leekelleher / Web.Template.MACHINE-NAME.Debug.config
Created August 22, 2012 19:22
Web.config transform for Umbraco core development
<?xml version="1.0"?>
<configuration xmlns:xdt="http://schemas.microsoft.com/XML-Document-Transform">
<appSettings>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDbDSN" value="server=.\SQLEXPRESS;database=umbraco;integrated security=true"/>
<!--<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDbDSN" value="datalayer=SQLCE4Umbraco.SqlCEHelper,SQLCE4Umbraco;data source=|DataDirectory|\Umbraco.sdf"/>-->
<!--<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoDbDSN" value="datalayer=MySQL;database=umbraco;server=localhost;user id=username;password=password;"/>-->
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoConfigurationStatus" value="4.9.0"/>
<add xdt:Transform="Replace" xdt:Locator="Match(key)" key="umbracoUseMediumTrust" value="true"/>
</appSettings>