Skip to content

Instantly share code, notes, and snippets.

@leekelleher
leekelleher / XPathDropDownListPropertyEditor.cs
Created January 16, 2014 11:13
Prototype for an Umbraco "XPath DropDownList" property editor.
using System.Collections.Generic;
using System.Linq;
using Umbraco.Core;
using Umbraco.Core.Models;
using Umbraco.Core.PropertyEditors;
using Umbraco.Core.Xml;
namespace Umbraco.Web.PropertyEditors
{
[PropertyEditor(Constants.PropertyEditors.XPathDropDownListAlias, "XPath DropDownList", "dropdown", ValueType = "INT")]
@leekelleher
leekelleher / cmsContentType_Usage.sql
Last active January 19, 2024 19:03
Umbraco - database analysis - SQL Queries
-- Copied from Hendy https://our.umbraco.org/forum/umbraco-7/using-umbraco-7/72814-creating-a-list-of-unused-doc-types#comment-233729
-- Find all unused docTypes
-- These results may contain docTypes that are masters of used ones, so need to exclude these too...
SELECT
A.nodeId as 'DocTypeId',
B.text AS 'Name',
A.alias AS 'Alias'
FROM
cmsContentType A LEFT JOIN
@leekelleher
leekelleher / ucomponents-data-list.md
Last active May 18, 2019 08:32
uComponents - potential data-type... Data List

uComponents - Data List

The idea is to have a provider-based property-editor for various data list types. To have a separation between the UI (editor control) and the data-source. e.g. a DropDownList shouldn't care where the data comes from, only that it's available and consistent.

Data List (types of)

  • DropDownList
  • CheckBoxList
  • AutoComplete
  • Templatable List
@leekelleher
leekelleher / template-animation.md
Last active December 19, 2015 19:38
Exploring the 'Template Animation' concept
@leekelleher
leekelleher / MyApplication.cs
Last active December 19, 2015 13:59
Example of Umbraco 6.1's IContentFinder
using Umbraco.Core;
using Umbraco.Core.Services;
using Umbraco.Web.Mvc;
using Umbraco.Web.Routing;
namespace Our.Umbraco
{
public class MyApplication : ApplicationEventHandler
{
protected override void ApplicationStarting(UmbracoApplicationBase umbracoApplication, ApplicationContext applicationContext)
@leekelleher
leekelleher / LondonBoroughs.cs
Created May 24, 2013 11:02
London Boroughs DropDownList DataType for Umbraco
using System;
using System.Collections.Generic;
using System.Web.UI.WebControls;
using umbraco.cms.businesslogic.datatype;
namespace Our.Umbraco.DataTypes
{
public class LondonBoroughs : AbstractDataEditor
{
private DropDownList m_Control = new DropDownList();
@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
@leekelleher
leekelleher / fetch-msbuild-tasks.cmd
Last active December 16, 2015 00:39
Fetches associated MSBuild Tasks packages (via NuGet), then copies the assemblies and targets to a /tools directory. To be used with https://github.com/leekelleher/umbraco-package-boilerplate
IF NOT EXIST tools\MSBuildTasks\NUL (GOTO FETCH) ELSE GOTO EXIST
:EXIST
ECHO MSBuildTasks already exist
:FETCH
ECHO Fetching MSBuildTasks via NuGet
:: Set the working directory
CD tools
@leekelleher
leekelleher / umbraco-find-nodes-by-property-value.sql
Last active October 3, 2017 14:10
Umbraco - Find nodes with specific property value
DECLARE @propertyAlias NVARCHAR(50);
DECLARE @search NVARCHAR(50);
SET @propertyAlias = 'bodyText';
SET @search = 'whatever';
SELECT
n.id,
n.path,
n.text
@leekelleher
leekelleher / RazorDataTypeModelBindingPropertyEditorValueConverter.cs
Created January 31, 2013 11:48
Umbraco: A bridge between RazorDataTypeModelBinding and PropertyEditorValueConverter.
using System;
using System.Collections.Generic;
using System.Linq;
using System.Reflection;
using umbraco.MacroEngines;
using Umbraco.Core;
using Umbraco.Core.PropertyEditors;
namespace Our.Umbraco
{