Skip to content

Instantly share code, notes, and snippets.

@perploug
perploug / gist:7334403
Last active October 11, 2016 12:57
how to hook into tree menus in V7
using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using Umbraco.Core;
namespace Meh.App_Code
{
public class ChangeMenu : ApplicationEventHandler
{
@joeriks
joeriks / 404handlers.config
Last active December 17, 2015 15:19
Catching all requests to URLs beneath a node if it has umbracoCatchAll=1, or at the same level if it's named * Example 1: add a document named * wherever and it will catch all "sibling" url calls (for example /products/* will catch /products/foo and /products/bar) Example 2: add a property umbracoCatchAll to a document and set it to 1 and it wil…
<?xml version="1.0" encoding="utf-8" ?>
<NotFoundHandlers>
<notFound assembly="umbraco" type="SearchForAlias" />
<notFound assembly="umbraco" type="SearchForTemplate"/>
<notFound assembly="umbraco" type="SearchForProfile"/>
<notFound assembly="CatchAllRouteHandler" namespace="Our" type="CatchAll"/>
<notFound assembly="umbraco" type="handle404"/>
</NotFoundHandlers>
using System;
using Umbraco.Core;
using Umbraco.Core.Persistence;
using Umbraco.Core.Persistence.DatabaseAnnotations;
namespace Umbraco.Examples
{
/// <summary>
/// Class that shows the use of creating a new table and inserting a new ArticlePoco.
/// This class is only intended for demo'ing and should not be used as it.
@warrenbuckley
warrenbuckley / install.ps1
Last active December 16, 2015 18:19
Umbraco API in Nugget install PowerShell
#Umbraco Power shell API
#Default Nugget Params
param($installPath, $toolsPath, $package, $project)
if ($project) {
#Connect to Umbraco Services API
#Create Home DocumentType
#Create Properties on Home DocumentType
@leekelleher
leekelleher / example.cs
Last active December 16, 2015 13:39
Example of using uQuery.IGetProperty with uTwit property-editor.
var node = uQuery.GetNode(1234);
var twitter = node.GetProperty<Our.Umbraco.Models.uTwit>("twitter");
// use the uTwit model...
// twitter.ConsumerKey
// twitter.ConsumerSecret
// twitter.OAuthToken
// twitter.OAuthTokenSecret
// twitter.ScreenName
using System;
using umbraco;
using Umbraco.Core;
using Umbraco.Core.Events;
using umbraco.interfaces;
namespace MyNameSpace
{
public class StartupEventHandlers : IApplicationStartupHandler
{
@joeriks
joeriks / BaseAsJson.cs
Created April 4, 2012 10:00
Add this file to your umbraco 4.7 App_Code and you will be able to add json-returning functions to base-urls
using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Web;
using umbraco.presentation.umbracobase;
using System.Web.Script.Serialization;
namespace BaseAsJson
{
@eligrey
eligrey / object-watch.js
Created April 30, 2010 01:38
object.watch polyfill in ES5
/*
* object.watch polyfill
*
* 2012-04-03
*
* By Eli Grey, http://eligrey.com
* Public Domain.
* NO WARRANTY EXPRESSED OR IMPLIED. USE AT YOUR OWN RISK.
*/