Skip to content

Instantly share code, notes, and snippets.

View ProNotion's full-sized avatar

ProNotion

  • Prolific Notion Ltd
  • Plymouth, UK
View GitHub Profile
@ProNotion
ProNotion / umbracoMembersWithLoginDate.sql
Last active June 27, 2023 08:33
Get Umbraco Members with last login date
SELECT m.LoginName, m.Email, cmsPropertyData.dataDate AS LastLoginDate
FROM cmsPropertyType INNER JOIN
cmsPropertyData ON
cmsPropertyType.id = cmsPropertyData.propertytypeid RIGHT OUTER JOIN
cmsMember AS m ON cmsPropertyData.contentNodeId = m.nodeId
WHERE (cmsPropertyType.Alias = N'umbracoMemberLastLogin') AND (cmsPropertyData.dataDate IS NOT NULL)
ORDER BY LastLoginDate DESC
@ProNotion
ProNotion / ModelsBuilderHelpers.cs
Last active November 10, 2023 14:07
Helper Method to get Umbraco ModelsBuilder Model Property Aliases
internal static string GetModelPropertyTypeAlias<TModel>(Expression<Func<TModel, object>> selector)
where TModel : PublishedElementModel
{
Expression body = selector.Body;
// Unwrap conversions, if any
if (body is UnaryExpression unaryExpression && unaryExpression.NodeType == ExpressionType.Convert)
body = unaryExpression.Operand;
if (!(body is MemberExpression memberExpression))
@ProNotion
ProNotion / MyServiceComposer.cs
Created May 23, 2024 13:19
Umbraco v12 - Add Custom field to Examine Index
public class MyServiceComposer : IComposer
{
public void Compose(IUmbracoBuilder builder)
{
builder.AddNotificationHandler<UmbracoApplicationStartedNotification, UmbracoStartedNotificationHandler>();
}
}
@ProNotion
ProNotion / DefaultValueOptions.html
Last active June 19, 2024 07:24
Umbraco Radio Button List With Default Value
<div ng-controller="RadioButtonListWithDefault.DropdownController as vm">
<select ng-model="vm.model.value">
<option ng-repeat="item in vm.items" value="{{item.value}}">
{{item.value}}
</option>
</select>
</div>
@ProNotion
ProNotion / Nodes-With-Saved-Unpublished-Changes.sql
Last active April 25, 2025 08:27
Umbraco 7 - Retrieve a list of nodes with saved but unpublished changes
-- Retrieves content items that have a newer, unpublished version than the currently published version.
SELECT
c.nodeId AS ContentId,
un.text AS NodeName,
CONCAT('https://example.com/umbraco#/content/content/edit/', c.nodeId) AS Link
FROM cmsContent c
JOIN cmsContentVersion cv ON c.nodeId = cv.ContentId
JOIN cmsDocument d ON c.nodeId = d.nodeId
JOIN umbracoNode un ON c.nodeId = un.id