Skip to content

Instantly share code, notes, and snippets.

Sebastiaan Janssen nul800sebastiaan

Block or report user

Report or block nul800sebastiaan

Hide content and notifications from this user.

Learn more about blocking users

Contact Support about this user’s behavior.

Learn more about reporting abuse

Report abuse
View GitHub Profile
nul800sebastiaan / Umbraco RSS feed example
Created Apr 20, 2011
Replace "//Article" with the nodeTypeAlias of which you want to create RSS items. Note that the "bodyText" property alias is being used for the article content.
View Umbraco RSS feed example
<?xml version="1.0" encoding="UTF-8"?>
exclude-result-prefixes="msxml umbraco.library">
nul800sebastiaan / gist:1042579
Created Jun 23, 2011
Conditional sorting for XSLTSearch 1.0
View gist:1042579
<xsl:when test="umbraco.library:RequestQueryString('sortbydate') != ''">
<xsl:for-each select="$matchedNodes">
<!-- sort on the page score of the node, within ALL the nodes to return (the sorting must happen before choosing the nodes for this page) -->
<xsl:sort select="@createDate" order="descending"/>
<!-- only the nodes for this page -->
<xsl:if test="position() &gt;= $startMatch and position() &lt;= $endMatch">
<xsl:call-template name="postlist" />
nul800sebastiaan / RenderArticleList.xslt
Created Jun 28, 2011
XSL Parameter doesn't work in a choose?!
View RenderArticleList.xslt
<xsl:template name="renderArticleList">
<xsl:param name="orderByPopularity"/>
<xsl:param name="addShowInLatestNewsList"/>
<xsl:when test="$orderByPopularity = 'true'">
== <xsl:value-of select="$addShowInLatestNewsList" /> ==
nul800sebastiaan / RemovePreviewButton.cs
Created Jul 4, 2011
Remove preview button in Umbraco
View RemovePreviewButton.cs
using System;
using umbraco.BusinessLogic;
using umbraco.presentation.masterpages;
namespace SomeCompanyName.EventHandlers
public class RemovePreviewButton : ApplicationBase
public RemovePreviewButton()
nul800sebastiaan / gist:1067257
Created Jul 6, 2011
Grouping in Razor (Umbraco 4.7.1)
View gist:1067257
@foreach(var group in Model.Children.InGroupsOf(2))
<div class="row-of-two">
@foreach(var item in group)
View first-attempt.cshtml
@helper RenderCountryOptions() {
<option>Choose a country...</option>
@foreach(var region in @Model.XPath("/root/Website/CountryList/CountryList[Country[not(active = 0)]]"))
<optgroup label="@region.Name">
@foreach(var country in @region.Children)
nul800sebastiaan / gist:1170848
Created Aug 25, 2011
Get a specific crop using Umbraco 4.7.1 Razor engine
View gist:1170848
Given this XML:
<NewsItem id="1140" parentID="1139" level="3" writerID="0" creatorID="0" nodeType="1137" template="1138" sortOrder="1" createDate="2011-08-10T13:46:53" updateDate="2011-08-25T16:51:18" nodeName="Test newsitem" urlName="test-newsitem" writerName="admin" creatorName="admin" path="-1,1051,1139,1140" isDoc="">
<introText><![CDATA[Minime vero, inquit ille, consentit. Quod si ita se habeat, non possit beatam praestare vitam sapientia.]]></introText>
nul800sebastiaan / EditPage.aspx
Created Sep 16, 2011
Adding save button to custom tree editpage
View EditPage.aspx
<%@ Page Language="C#" MasterPageFile="../../masterpages/umbracoPage.Master" AutoEventWireup="True" CodeBehind="EditPage.aspx.cs" Inherits="SomeCompany.CustomTrees.EditPage" %>
<%@ Register Namespace="umbraco.uicontrols" Assembly="controls" TagPrefix="umb" %>
<asp:Content ID="Content" ContentPlaceHolderID="body" runat="server">
<umb:UmbracoPanel ID="Panel1" runat="server" hasMenu="true" Text="Edit Group">
<umb:Pane ID="Pane1" runat="server">
<umb:PropertyPanel ID="PPanel0" runat="server" Text="Name">
<asp:TextBox ID="Name" runat="server" MaxLength="150" CssClass="guiInputText guiInputStandardSize"></asp:TextBox>
nul800sebastiaan / gist:1241761
Created Sep 26, 2011
Modify the body tag with Razor in Umbraco
View gist:1241761
<umbraco:Macro runat="server" Language="cshtml">
<body class="@Model.NodeTypeAlias.ToLower().Replace(" ", "-")">
View gist:1250799
<xsl:variable name="myBoolean" select="$currentPage/prop = '1'" />
<!-- Doesn't work! -->
<xsl:value-of select="myTest:GetResult($myBoolean)" />
<!-- Works.. -->
<xsl:value-of select="myTest:GetResult($currentPage/prop = '1')" />
You can’t perform that action at this time.