Skip to content

Instantly share code, notes, and snippets.

View uniquelau's full-sized avatar

Laurence Gillian uniquelau

View GitHub Profile
@uniquelau
uniquelau / navMain.xslt
Created July 14, 2011 10:21
Navigation Main
<?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:umb="urn:umbraco.library"
exclude-result-prefixes="msxml umb">
<xsl:output method="xml" omit-xml-declaration="yes"/>
@uniquelau
uniquelau / gist:1111527
Created July 28, 2011 13:20
Get Parent Width, Calculate difference as Percentage
$('#nav-1 li .dropdown').each(function(){
var parent_width = (((($(this).width() - $(this).parent().width()) / '2') / $(this).parent().width()) * '100') + '';
var percent_round = Number(parent_width).toFixed(2);
$(this).css('margin-left' , '-' + (percent_round) + '%');
});
@uniquelau
uniquelau / gist:1188408
Created September 2, 2011 11:24
Hide Nodes in Umbraco Tree
using System;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.web;
using umbraco.cms.presentation.Trees;
using umbraco.interfaces;
namespace Abbott.Corporate.Logic.Events
{
public class HideGridNodeOnLoad : ApplicationBase
@uniquelau
uniquelau / gist:1194602
Created September 5, 2011 09:56
Event Handler - Create Child Document
using System;
using umbraco.BusinessLogic;
using umbraco.cms.businesslogic.web;
using umbraco.cms.presentation.Trees;
using umbraco.interfaces;
namespace Asda.Jobs.EventHandlers
{
public class CreateDisciplinesOnComplexArticleCreation : ApplicationBase
{
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umb="urn:umbraco.library"
exclude-result-prefixes="umb"
>
<xsl:output method="xml" omit-xml-declaration="yes"/>
@uniquelau
uniquelau / gist:1222294
Created September 16, 2011 14:57
jQuery - Even stuff
// jQuery Library
(function ($) {
$.fn.even = function () {
var jQ = $();
jQ.context = this.context;
jQ.selector = this.selector;
for (var i = j = 0, l = this.length; i < l; i += 2, j++)
jQ[j] = this[i];
return jQ;
};
@uniquelau
uniquelau / navFiltered.xslt
Created September 29, 2011 10:28
navFiltered
<?xml version="1.0" encoding="utf-8" ?>
<!DOCTYPE xsl:stylesheet [
<!-- For easier customization -->
<!ENTITY NotDoc "not(self::layoutGridFolders)">
<!-- Compatibility stuff -->
<!ENTITY NiceUrl "umb:NiceUrl">
]>
@uniquelau
uniquelau / column-calcs.xslt
Created March 9, 2012 14:53
Column Calculations
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umb="urn:umbraco.library"
exclude-result-prefixes="umb"
>
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>
@uniquelau
uniquelau / Navigation Filtered
Created August 15, 2012 16:25
navFiltered.xslt
<?xml version="1.0" encoding="UTF-8"?>
<xsl:stylesheet
version="1.0"
xmlns:xsl="http://www.w3.org/1999/XSL/Transform"
xmlns:umb="urn:umbraco.library"
exclude-result-prefixes="umb"
>
<xsl:output method="xml" omit-xml-declaration="yes"/>
<xsl:param name="currentPage"/>