Skip to content

Instantly share code, notes, and snippets.

View FransdeJong's full-sized avatar

Frans de Jong FransdeJong

View GitHub Profile
@FransdeJong
FransdeJong / IPublishContentExtension.cs
Created June 17, 2021 13:25
Check filetype of Umbraco mediapicker
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web;
namespace SomeNamespace
{
public static class IPublishedContentExtensions
{
public static MediaFileType GetMediaFiletype(this IPublishedContent mediaItem)
{
if (mediaItem == null)
@FransdeJong
FransdeJong / ImagesController.cs
Created June 29, 2021 08:41
Serve Umbraco image property with static Url
using System.Linq;
using System.Web;
using System.Web.Mvc;
using Newtonsoft.Json.Linq;
using Umbraco.Core.Composing;
using Umbraco.Core.Models.PublishedContent;
using Umbraco.Web;
using Umbraco.Web.Mvc;
using Umbraco.Web.PublishedModels;
@FransdeJong
FransdeJong / Rewritemaps.config
Created May 10, 2022 07:56
Rewritemap for static rewrites
<rewriteMaps>
<rewriteMap name="nlRewrites">
<add key="/" value="https://www.newdomain.eu/nl"/>
<add key="/het-bedrijf" value="https://www.newdomain.eu/nl/over-ons/"/>
<add key="/producten/lamp value="https://www.newdomain.eu/nl/producten/verlichting/lamp"/>
</rewriteMap>
</rewriteMaps>