diff --git a/.github/workflows/codeql-analysis.yml b/.github/workflows/codeql-analysis.yml index 18f8876..03d6b90 100644 --- a/.github/workflows/codeql-analysis.yml +++ b/.github/workflows/codeql-analysis.yml @@ -43,15 +43,13 @@ jobs: with: fetch-depth: 0 - - name: Setup .NET - uses: actions/setup-dotnet@v1 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - dotnet-version: '5.0.x' - - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '6.0.x' + dotnet-version: | + 5.0.x + 6.0.x + 9.0.x # Initializes the CodeQL tools for scanning. - name: Initialize CodeQL diff --git a/.github/workflows/dotnet.yml b/.github/workflows/dotnet.yml index 6f561a5..5587bc6 100644 --- a/.github/workflows/dotnet.yml +++ b/.github/workflows/dotnet.yml @@ -13,23 +13,21 @@ jobs: steps: - name: Install GitVersion - uses: gittools/actions/gitversion/setup@v0.9.7 + uses: gittools/actions/gitversion/setup@v4.1.0 with: - versionSpec: '5.x' + versionSpec: '6.x' - - uses: actions/checkout@v2 + - uses: actions/checkout@v4 with: fetch-depth: 0 - - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '5.0.x' - - name: Setup .NET - uses: actions/setup-dotnet@v1 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: | + 5.0.x + 6.0.x + 9.0.x - name: Restore dependencies run: dotnet restore @@ -37,10 +35,10 @@ jobs: - name: Determine Version with GitVersion (MSBuild in Proj will do this) id: gitversion - uses: gittools/actions/gitversion/execute@v0.9.7 + uses: gittools/actions/gitversion/execute@v4.1.0 with: - useConfigFile: true - configFilePath: ./GitVersion.yml + configFilePath: GitVersion.yml + updateAssemblyInfo: true - name: Display GitVersion outputs - Help for debugging for now run: | @@ -90,7 +88,7 @@ jobs: working-directory: Our.Umbraco.TagHelpers - name: Upload nuget file as build artifact - uses: actions/upload-artifact@v2 + uses: actions/upload-artifact@v4 with: name: Nuget Build Output path: ./build.out/ diff --git a/.github/workflows/release-nuget.yml b/.github/workflows/release-nuget.yml index 5008d3a..89db05c 100644 --- a/.github/workflows/release-nuget.yml +++ b/.github/workflows/release-nuget.yml @@ -20,16 +20,14 @@ jobs: - uses: actions/checkout@v2 with: fetch-depth: 0 - - - name: Setup .NET - uses: actions/setup-dotnet@v1 - with: - dotnet-version: '5.0.x' - - name: Setup .NET - uses: actions/setup-dotnet@v1 + - name: Setup .NET SDK + uses: actions/setup-dotnet@v4 with: - dotnet-version: '6.0.x' + dotnet-version: | + 5.0.x + 6.0.x + 9.0.x - name: Restore dependencies run: dotnet restore diff --git a/.gitignore b/.gitignore index 976661b..727be7e 100644 --- a/.gitignore +++ b/.gitignore @@ -385,4 +385,6 @@ FodyWeavers.xsd # JetBrains Rider .idea/ -*.sln.iml \ No newline at end of file +*.sln.iml +.DS_Store +Our.Umbraco.TagHelpers.TestSite/wwwroot/assets diff --git a/GitVersion.yml b/GitVersion.yml index 6396986..0371520 100644 --- a/GitVersion.yml +++ b/GitVersion.yml @@ -3,7 +3,7 @@ mode: ContinuousDeployment branches: main: mode: ContinuousDeployment - tag: '' + label: '' pull-request: mode: ContinuousDeployment ignore: diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Program.cs b/Our.Umbraco.TagHelpers.ExampleSite/Program.cs deleted file mode 100644 index 98153ad..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Program.cs +++ /dev/null @@ -1,19 +0,0 @@ -namespace Our.Umbraco.TagHelpers.ExampleSite -{ - public class Program - { - public static void Main(string[] args) - => CreateHostBuilder(args) - .Build() - .Run(); - - public static IHostBuilder CreateHostBuilder(string[] args) => - Host.CreateDefaultBuilder(args) - .ConfigureUmbracoDefaults() - .ConfigureWebHostDefaults(webBuilder => - { - webBuilder.UseStaticWebAssets(); - webBuilder.UseStartup(); - }); - } -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Startup.cs b/Our.Umbraco.TagHelpers.ExampleSite/Startup.cs deleted file mode 100644 index 0dcca01..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Startup.cs +++ /dev/null @@ -1,65 +0,0 @@ -namespace Our.Umbraco.TagHelpers.ExampleSite -{ - public class Startup - { - private readonly IWebHostEnvironment _env; - private readonly IConfiguration _config; - - /// - /// Initializes a new instance of the class. - /// - /// The web hosting environment. - /// The configuration. - /// - /// Only a few services are possible to be injected here https://github.com/dotnet/aspnetcore/issues/9337. - /// - public Startup(IWebHostEnvironment webHostEnvironment, IConfiguration config) - { - _env = webHostEnvironment ?? throw new ArgumentNullException(nameof(webHostEnvironment)); - _config = config ?? throw new ArgumentNullException(nameof(config)); - } - - /// - /// Configures the services. - /// - /// The services. - /// - /// This method gets called by the runtime. Use this method to add services to the container. - /// For more information on how to configure your application, visit https://go.microsoft.com/fwlink/?LinkID=398940. - /// - public void ConfigureServices(IServiceCollection services) - { - services.AddUmbraco(_env, _config) - .AddBackOffice() - .AddWebsite() - .AddComposers() - .Build(); - } - - /// - /// Configures the application. - /// - /// The application builder. - /// The web hosting environment. - public void Configure(IApplicationBuilder app, IWebHostEnvironment env) - { - if (env.IsDevelopment()) - { - app.UseDeveloperExceptionPage(); - } - - app.UseUmbraco() - .WithMiddleware(u => - { - u.UseBackOffice(); - u.UseWebsite(); - }) - .WithEndpoints(u => - { - u.UseInstallerEndpoints(); - u.UseBackOfficeEndpoints(); - u.UseWebsiteEndpoints(); - }); - } - } -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3-fluid.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3-fluid.cshtml deleted file mode 100644 index b92734e..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3-fluid.cshtml +++ /dev/null @@ -1,106 +0,0 @@ -@using System.Web -@using Microsoft.AspNetCore.Html -@using Newtonsoft.Json.Linq -@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage - -@* - Razor helpers located at the bottom of this file -*@ - -@if (Model is JObject && Model?.sections is not null) -{ - var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; - -
- @if (oneColumn) - { - foreach (var section in Model.sections) - { -
- @foreach (var row in section.rows) - { - renderRow(row); - } -
- } - } - else - { -
- @foreach (var sec in Model.sections) - { -
-
- @foreach (var row in sec.rows) - { - renderRow(row); - } -
-
- } -
- } -
-} - -@functions{ - - private async Task renderRow(dynamic row) - { -
-
- @foreach (var area in row.areas) - { -
-
- @foreach (var control in area.controls) - { - if (control?.editor?.view != null) - { - @await Html.PartialAsync("grid/editors/base", (object)control) - } - } -
-
- } -
-
- } -} - -@functions{ - - public static HtmlString RenderElementAttributes(dynamic contentItem) - { - var attrs = new List(); - JObject cfg = contentItem.config; - - if (cfg != null) - { - foreach (JProperty property in cfg.Properties()) - { - var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); - attrs.Add(property.Name + "=\"" + propertyValue + "\""); - } - } - - JObject style = contentItem.styles; - - if (style != null) { - var cssVals = new List(); - foreach (JProperty property in style.Properties()) - { - var propertyValue = property.Value.ToString(); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - cssVals.Add(property.Name + ":" + propertyValue + ";"); - } - } - - if (cssVals.Any()) - attrs.Add("style='" + HttpUtility.HtmlAttributeEncode(string.Join(" ", cssVals)) + "'"); - } - - return new HtmlString(string.Join(" ", attrs)); - } -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3.cshtml deleted file mode 100644 index 8863788..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/bootstrap3.cshtml +++ /dev/null @@ -1,112 +0,0 @@ -@using System.Web -@using Microsoft.AspNetCore.Html -@using Newtonsoft.Json.Linq -@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage - -@if (Model is JObject && Model?.sections is not null) -{ - var oneColumn = ((System.Collections.ICollection)Model.sections).Count == 1; - -
- @if (oneColumn) - { - foreach (var section in Model.sections) - { -
- @foreach (var row in section.rows) - { - renderRow(row, true); - } -
- } - } - else - { -
-
- @foreach (var sec in Model.sections) - { -
-
- @foreach (var row in sec.rows) - { - renderRow(row, false); - } -
-
- } -
-
- } -
-} - -@functions{ - - private async Task renderRow(dynamic row, bool singleColumn) - { -
- @if (singleColumn) { - @:
- } -
- @foreach (var area in row.areas) - { -
-
- @foreach (var control in area.controls) - { - if (control?.editor?.view != null) - { - @await Html.PartialAsync("grid/editors/base", (object)control) - } - } -
-
- } -
- @if (singleColumn) { - @:
- } -
- } - -} - -@functions{ - - public static HtmlString RenderElementAttributes(dynamic contentItem) - { - var attrs = new List(); - JObject cfg = contentItem.config; - - if (cfg != null) - { - foreach (JProperty property in cfg.Properties()) - { - var propertyValue = HttpUtility.HtmlAttributeEncode(property.Value.ToString()); - attrs.Add(property.Name + "=\"" + propertyValue + "\""); - } - } - - JObject style = contentItem.styles; - - if (style != null) - { - var cssVals = new List(); - foreach (JProperty property in style.Properties()) - { - var propertyValue = property.Value.ToString(); - if (string.IsNullOrWhiteSpace(propertyValue) == false) - { - cssVals.Add(property.Name + ":" + propertyValue + ";"); - } - } - - if (cssVals.Any()) - attrs.Add("style=\"" + HttpUtility.HtmlAttributeEncode(string.Join(" ", cssVals)) + "\""); - } - - return new HtmlString(string.Join(" ", attrs)); - } -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/base.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/base.cshtml deleted file mode 100644 index e40543b..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/base.cshtml +++ /dev/null @@ -1,27 +0,0 @@ -@model dynamic - -@try -{ - string editor = EditorView(Model); - @await Html.PartialAsync(editor, Model as object) -} -catch (Exception ex) -{ -
@ex.ToString()
-} - -@functions{ - - public static string EditorView(dynamic contentItem) - { - string view = contentItem.editor.render != null ? contentItem.editor.render.ToString() : contentItem.editor.view.ToString(); - view = view.Replace(".html", ".cshtml"); - - if (!view.Contains("/")) - { - view = "grid/editors/" + view; - } - - return view; - } -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/embed.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/embed.cshtml deleted file mode 100644 index 74c8fe2..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/embed.cshtml +++ /dev/null @@ -1,11 +0,0 @@ -@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage - -@if (Model is not null) -{ - string embedValue = Convert.ToString(Model.value); - embedValue = embedValue.DetectIsJson() ? Model.value.preview : Model.value; - -
- @Html.Raw(embedValue) -
-} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/macro.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/macro.cshtml deleted file mode 100644 index a4450d1..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/macro.cshtml +++ /dev/null @@ -1,15 +0,0 @@ -@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage - -@if (Model?.value is not null) -{ - string macroAlias = Model.value.macroAlias.ToString(); - var parameters = new Dictionary(); - foreach (var mpd in Model.value.macroParamsDictionary) - { - parameters.Add(mpd.Name, mpd.Value); - } - - - @await Umbraco.RenderMacroAsync(macroAlias, parameters) - -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/media.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/media.cshtml deleted file mode 100644 index bc3b111..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/media.cshtml +++ /dev/null @@ -1,64 +0,0 @@ -@model dynamic -@using Umbraco.Cms.Core.Media -@using Umbraco.Cms.Core.PropertyEditors.ValueConverters -@inject IImageUrlGenerator ImageUrlGenerator - -@if (Model?.value is not null) -{ - var url = Model.value.image; - - if (Model.editor.config != null && Model.editor.config.size != null) - { - if (Model.value.coordinates != null) - { - url = ImageCropperTemplateCoreExtensions.GetCropUrl( - (string)url, - ImageUrlGenerator, - width: (int)Model.editor.config.size.width, - height: (int)Model.editor.config.size.height, - cropAlias: "default", - cropDataSet: new ImageCropperValue - { - Crops = new[] - { - new ImageCropperValue.ImageCropperCrop - { - Alias = "default", - Coordinates = new ImageCropperValue.ImageCropperCropCoordinates - { - X1 = (decimal)Model.value.coordinates.x1, - Y1 = (decimal)Model.value.coordinates.y1, - X2 = (decimal)Model.value.coordinates.x2, - Y2 = (decimal)Model.value.coordinates.y2 - } - } - } - }); - } - else - { - url = ImageCropperTemplateCoreExtensions.GetCropUrl( - (string)url, - ImageUrlGenerator, - width: (int)Model.editor.config.size.width, - height: (int)Model.editor.config.size.height, - cropDataSet: new ImageCropperValue - { - FocalPoint = new ImageCropperValue.ImageCropperFocalPoint - { - Top = Model.value.focalPoint == null ? 0.5m : Model.value.focalPoint.top, - Left = Model.value.focalPoint == null ? 0.5m : Model.value.focalPoint.left - } - }); - } - } - - var altText = Model.value.altText ?? Model.value.caption ?? string.Empty; - - @altText - - if (Model.value.caption != null) - { -

@Model.value.caption

- } -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/rte.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/rte.cshtml deleted file mode 100644 index 9445666..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/rte.cshtml +++ /dev/null @@ -1,13 +0,0 @@ -@using Umbraco.Cms.Core.Templates -@model dynamic -@inject HtmlLocalLinkParser HtmlLocalLinkParser; -@inject HtmlUrlParser HtmlUrlParser; -@inject HtmlImageSourceParser HtmlImageSourceParser; - -@{ - var value = HtmlLocalLinkParser.EnsureInternalLinks(Model?.value.ToString()); - value = HtmlUrlParser.EnsureUrls(value); - value = HtmlImageSourceParser.EnsureImageSources(value); -} - -@Html.Raw(value) diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/textstring.cshtml b/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/textstring.cshtml deleted file mode 100644 index d4152a5..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/grid/editors/textstring.cshtml +++ /dev/null @@ -1,23 +0,0 @@ -@using System.Web -@model dynamic - -@if (Model?.editor.config.markup is not null) -{ - string markup = Model.editor.config.markup.ToString(); - markup = markup.Replace("#value#", Html.ReplaceLineBreaks((string)Model.value.ToString()).ToString()); - - if (Model.editor.config.style != null) - { - markup = markup.Replace("#style#", Model.editor.config.style.ToString()); - } - - - @Html.Raw(markup) - -} -else -{ - -
@Model?.value
-
-} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/appsettings.Development.json b/Our.Umbraco.TagHelpers.ExampleSite/appsettings.Development.json deleted file mode 100644 index 91cd2da..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/appsettings.Development.json +++ /dev/null @@ -1,34 +0,0 @@ -{ - "$schema": "./appsettings-schema.json", - "Serilog": { - "MinimumLevel": { - "Default": "Information" - }, - "WriteTo": [ - { - "Name": "Async", - "Args": { - "configure": [ - { - "Name": "Console" - } - ] - } - } - ] - }, - "Umbraco": { - "CMS": { - "Content": { - "MacroErrors": "Throw" - }, - "Hosting": { - "Debug": true - }, - "RuntimeMinification": { - "UseInMemoryCache": true, - "CacheBuster": "Timestamp" - } - } - } -} diff --git a/Our.Umbraco.TagHelpers.ExampleSite/appsettings.json b/Our.Umbraco.TagHelpers.ExampleSite/appsettings.json deleted file mode 100644 index 90ff8a8..0000000 --- a/Our.Umbraco.TagHelpers.ExampleSite/appsettings.json +++ /dev/null @@ -1,30 +0,0 @@ -{ - "$schema": "./appsettings-schema.json", - "Serilog": { - "MinimumLevel": { - "Default": "Information", - "Override": { - "Microsoft": "Warning", - "Microsoft.Hosting.Lifetime": "Information", - "System": "Warning" - } - } - }, - "Umbraco": { - "CMS": { - "Global": { - "Id": "21636f95-4863-407f-8119-19972ea6c3af", - "SanitizeTinyMce": true - }, - "Content": { - "ContentVersionCleanupPolicy": { - "EnableCleanup": true - } - } - } - }, - "ConnectionStrings": { - "umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True", - "umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite" - } -} \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.ExampleSite/wwwroot/favicon.ico b/Our.Umbraco.TagHelpers.ExampleSite/wwwroot/favicon.ico deleted file mode 100644 index c0749dd..0000000 Binary files a/Our.Umbraco.TagHelpers.ExampleSite/wwwroot/favicon.ico and /dev/null differ diff --git a/Our.Umbraco.TagHelpers.ExampleSite/.gitignore b/Our.Umbraco.TagHelpers.TestSite/.gitignore similarity index 92% rename from Our.Umbraco.TagHelpers.ExampleSite/.gitignore rename to Our.Umbraco.TagHelpers.TestSite/.gitignore index d183720..bfbb845 100644 --- a/Our.Umbraco.TagHelpers.ExampleSite/.gitignore +++ b/Our.Umbraco.TagHelpers.TestSite/.gitignore @@ -1,478 +1,482 @@ -## Ignore Visual Studio temporary files, build results, and -## files generated by popular Visual Studio add-ons. -## -## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore - -# User-specific files -*.rsuser -*.suo -*.user -*.userosscache -*.sln.docstates - -# User-specific files (MonoDevelop/Xamarin Studio) -*.userprefs - -# Mono auto generated files -mono_crash.* - -# Build results -[Dd]ebug/ -[Dd]ebugPublic/ -[Rr]elease/ -[Rr]eleases/ -x64/ -x86/ -[Ww][Ii][Nn]32/ -[Aa][Rr][Mm]/ -[Aa][Rr][Mm]64/ -bld/ -[Bb]in/ -[Oo]bj/ -[Ll]og/ -[Ll]ogs/ - -# Visual Studio 2015/2017 cache/options directory -.vs/ -# Uncomment if you have tasks that create the project's static files in wwwroot -#wwwroot/ - -# Visual Studio 2017 auto generated files -Generated\ Files/ - -# MSTest test Results -[Tt]est[Rr]esult*/ -[Bb]uild[Ll]og.* - -# NUnit -*.VisualState.xml -TestResult.xml -nunit-*.xml - -# Build Results of an ATL Project -[Dd]ebugPS/ -[Rr]eleasePS/ -dlldata.c - -# Benchmark Results -BenchmarkDotNet.Artifacts/ - -# .NET Core -project.lock.json -project.fragment.lock.json -artifacts/ - -# Tye -.tye/ - -# ASP.NET Scaffolding -ScaffoldingReadMe.txt - -# StyleCop -StyleCopReport.xml - -# Files built by Visual Studio -*_i.c -*_p.c -*_h.h -*.ilk -*.meta -*.obj -*.iobj -*.pch -*.pdb -*.ipdb -*.pgc -*.pgd -*.rsp -*.sbr -*.tlb -*.tli -*.tlh -*.tmp -*.tmp_proj -*_wpftmp.csproj -*.log -*.vspscc -*.vssscc -.builds -*.pidb -*.svclog -*.scc - -# Chutzpah Test files -_Chutzpah* - -# Visual C++ cache files -ipch/ -*.aps -*.ncb -*.opendb -*.opensdf -*.sdf -*.cachefile -*.VC.db -*.VC.VC.opendb - -# Visual Studio profiler -*.psess -*.vsp -*.vspx -*.sap - -# Visual Studio Trace Files -*.e2e - -# TFS 2012 Local Workspace -$tf/ - -# Guidance Automation Toolkit -*.gpState - -# ReSharper is a .NET coding add-in -_ReSharper*/ -*.[Rr]e[Ss]harper -*.DotSettings.user - -# TeamCity is a build add-in -_TeamCity* - -# DotCover is a Code Coverage Tool -*.dotCover - -# AxoCover is a Code Coverage Tool -.axoCover/* -!.axoCover/settings.json - -# Coverlet is a free, cross platform Code Coverage Tool -coverage*.json -coverage*.xml -coverage*.info - -# Visual Studio code coverage results -*.coverage -*.coveragexml - -# NCrunch -_NCrunch_* -.*crunch*.local.xml -nCrunchTemp_* - -# MightyMoose -*.mm.* -AutoTest.Net/ - -# Web workbench (sass) -.sass-cache/ - -# Installshield output folder -[Ee]xpress/ - -# DocProject is a documentation generator add-in -DocProject/buildhelp/ -DocProject/Help/*.HxT -DocProject/Help/*.HxC -DocProject/Help/*.hhc -DocProject/Help/*.hhk -DocProject/Help/*.hhp -DocProject/Help/Html2 -DocProject/Help/html - -# Click-Once directory -publish/ - -# Publish Web Output -*.[Pp]ublish.xml -*.azurePubxml -# Note: Comment the next line if you want to checkin your web deploy settings, -# but database connection strings (with potential passwords) will be unencrypted -*.pubxml -*.publishproj - -# Microsoft Azure Web App publish settings. Comment the next line if you want to -# checkin your Azure Web App publish settings, but sensitive information contained -# in these scripts will be unencrypted -PublishScripts/ - -# NuGet Packages -*.nupkg -# NuGet Symbol Packages -*.snupkg -# The packages folder can be ignored because of Package Restore -**/[Pp]ackages/* -# except build/, which is used as an MSBuild target. -!**/[Pp]ackages/build/ -# Uncomment if necessary however generally it will be regenerated when needed -#!**/[Pp]ackages/repositories.config -# NuGet v3's project.json files produces more ignorable files -*.nuget.props -*.nuget.targets - -# Microsoft Azure Build Output -csx/ -*.build.csdef - -# Microsoft Azure Emulator -ecf/ -rcf/ - -# Windows Store app package directories and files -AppPackages/ -BundleArtifacts/ -Package.StoreAssociation.xml -_pkginfo.txt -*.appx -*.appxbundle -*.appxupload - -# Visual Studio cache files -# files ending in .cache can be ignored -*.[Cc]ache -# but keep track of directories ending in .cache -!?*.[Cc]ache/ - -# Others -ClientBin/ -~$* -*~ -*.dbmdl -*.dbproj.schemaview -*.jfm -*.pfx -*.publishsettings -orleans.codegen.cs - -# Including strong name files can present a security risk -# (https://github.com/github/gitignore/pull/2483#issue-259490424) -#*.snk - -# Since there are multiple workflows, uncomment next line to ignore bower_components -# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) -#bower_components/ - -# RIA/Silverlight projects -Generated_Code/ - -# Backup & report files from converting an old project file -# to a newer Visual Studio version. Backup files are not needed, -# because we have git ;-) -_UpgradeReport_Files/ -Backup*/ -UpgradeLog*.XML -UpgradeLog*.htm -ServiceFabricBackup/ -*.rptproj.bak - -# SQL Server files -*.mdf -*.ldf -*.ndf - -# Business Intelligence projects -*.rdl.data -*.bim.layout -*.bim_*.settings -*.rptproj.rsuser -*- [Bb]ackup.rdl -*- [Bb]ackup ([0-9]).rdl -*- [Bb]ackup ([0-9][0-9]).rdl - -# Microsoft Fakes -FakesAssemblies/ - -# GhostDoc plugin setting file -*.GhostDoc.xml - -# Node.js Tools for Visual Studio -.ntvs_analysis.dat -node_modules/ - -# Visual Studio 6 build log -*.plg - -# Visual Studio 6 workspace options file -*.opt - -# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) -*.vbw - -# Visual Studio LightSwitch build output -**/*.HTMLClient/GeneratedArtifacts -**/*.DesktopClient/GeneratedArtifacts -**/*.DesktopClient/ModelManifest.xml -**/*.Server/GeneratedArtifacts -**/*.Server/ModelManifest.xml -_Pvt_Extensions - -# Paket dependency manager -.paket/paket.exe -paket-files/ - -# FAKE - F# Make -.fake/ - -# CodeRush personal settings -.cr/personal - -# Python Tools for Visual Studio (PTVS) -__pycache__/ -*.pyc - -# Cake - Uncomment if you are using it -# tools/** -# !tools/packages.config - -# Tabs Studio -*.tss - -# Telerik's JustMock configuration file -*.jmconfig - -# BizTalk build output -*.btp.cs -*.btm.cs -*.odx.cs -*.xsd.cs - -# OpenCover UI analysis results -OpenCover/ - -# Azure Stream Analytics local run output -ASALocalRun/ - -# MSBuild Binary and Structured Log -*.binlog - -# NVidia Nsight GPU debugger configuration file -*.nvuser - -# MFractors (Xamarin productivity tool) working folder -.mfractor/ - -# Local History for Visual Studio -.localhistory/ - -# BeatPulse healthcheck temp database -healthchecksdb - -# Backup folder for Package Reference Convert tool in Visual Studio 2017 -MigrationBackup/ - -# Ionide (cross platform F# VS Code tools) working folder -.ionide/ - -# Fody - auto-generated XML schema -FodyWeavers.xsd - -## -## Visual studio for Mac -## - - -# globs -Makefile.in -*.userprefs -*.usertasks -config.make -config.status -aclocal.m4 -install-sh -autom4te.cache/ -*.tar.gz -tarballs/ -test-results/ - -# Mac bundle stuff -*.dmg -*.app - -# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore -# General -.DS_Store -.AppleDouble -.LSOverride - -# Icon must end with two \r -Icon - - -# Thumbnails -._* - -# Files that might appear in the root of a volume -.DocumentRevisions-V100 -.fseventsd -.Spotlight-V100 -.TemporaryItems -.Trashes -.VolumeIcon.icns -.com.apple.timemachine.donotpresent - -# Directories potentially created on remote AFP share -.AppleDB -.AppleDesktop -Network Trash Folder -Temporary Items -.apdisk - -# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore -# Windows thumbnail cache files -Thumbs.db -ehthumbs.db -ehthumbs_vista.db - -# Dump file -*.stackdump - -# Folder config file -[Dd]esktop.ini - -# Recycle Bin used on file shares -$RECYCLE.BIN/ - -# Windows Installer files -*.cab -*.msi -*.msix -*.msm -*.msp - -# Windows shortcuts -*.lnk - -# JetBrains Rider -.idea/ -*.sln.iml - -## -## Visual Studio Code -## -.vscode/* -!.vscode/settings.json -!.vscode/tasks.json -!.vscode/launch.json -!.vscode/extensions.json - -## -## Umbraco CMS -## - -# JSON schema file for appsettings.json -appsettings-schema.json - -# Packages created from the backoffice (package.xml/package.zip) -/umbraco/Data/CreatedPackages/ - -# Temp folder containing Examine indexes, NuCache, MediaCache, etc. -/umbraco/Data/TEMP/ - -# SQLite database files -/umbraco/Data/*.sqlite.db -/umbraco/Data/*.sqlite.db-shm -/umbraco/Data/*.sqlite.db-wal - -# Log files -/umbraco/Logs/ - -# Media files -/wwwroot/media/ +## Ignore Visual Studio temporary files, build results, and +## files generated by popular Visual Studio add-ons. +## +## Get latest from https://github.com/github/gitignore/blob/master/VisualStudio.gitignore + +# User-specific files +*.rsuser +*.suo +*.user +*.userosscache +*.sln.docstates + +# User-specific files (MonoDevelop/Xamarin Studio) +*.userprefs + +# Mono auto generated files +mono_crash.* + +# Build results +[Dd]ebug/ +[Dd]ebugPublic/ +[Rr]elease/ +[Rr]eleases/ +x64/ +x86/ +[Ww][Ii][Nn]32/ +[Aa][Rr][Mm]/ +[Aa][Rr][Mm]64/ +bld/ +[Bb]in/ +[Oo]bj/ +[Ll]og/ +[Ll]ogs/ + +# Visual Studio 2015/2017 cache/options directory +.vs/ +# Uncomment if you have tasks that create the project's static files in wwwroot +#wwwroot/ + +# Visual Studio 2017 auto generated files +Generated\ Files/ + +# MSTest test Results +[Tt]est[Rr]esult*/ +[Bb]uild[Ll]og.* + +# NUnit +*.VisualState.xml +TestResult.xml +nunit-*.xml + +# Build Results of an ATL Project +[Dd]ebugPS/ +[Rr]eleasePS/ +dlldata.c + +# Benchmark Results +BenchmarkDotNet.Artifacts/ + +# .NET Core +project.lock.json +project.fragment.lock.json +artifacts/ + +# Tye +.tye/ + +# ASP.NET Scaffolding +ScaffoldingReadMe.txt + +# StyleCop +StyleCopReport.xml + +# Files built by Visual Studio +*_i.c +*_p.c +*_h.h +*.ilk +*.meta +*.obj +*.iobj +*.pch +*.pdb +*.ipdb +*.pgc +*.pgd +*.rsp +*.sbr +*.tlb +*.tli +*.tlh +*.tmp +*.tmp_proj +*_wpftmp.csproj +*.log +*.vspscc +*.vssscc +.builds +*.pidb +*.svclog +*.scc + +# Chutzpah Test files +_Chutzpah* + +# Visual C++ cache files +ipch/ +*.aps +*.ncb +*.opendb +*.opensdf +*.sdf +*.cachefile +*.VC.db +*.VC.VC.opendb + +# Visual Studio profiler +*.psess +*.vsp +*.vspx +*.sap + +# Visual Studio Trace Files +*.e2e + +# TFS 2012 Local Workspace +$tf/ + +# Guidance Automation Toolkit +*.gpState + +# ReSharper is a .NET coding add-in +_ReSharper*/ +*.[Rr]e[Ss]harper +*.DotSettings.user + +# TeamCity is a build add-in +_TeamCity* + +# DotCover is a Code Coverage Tool +*.dotCover + +# AxoCover is a Code Coverage Tool +.axoCover/* +!.axoCover/settings.json + +# Coverlet is a free, cross platform Code Coverage Tool +coverage*.json +coverage*.xml +coverage*.info + +# Visual Studio code coverage results +*.coverage +*.coveragexml + +# NCrunch +_NCrunch_* +.*crunch*.local.xml +nCrunchTemp_* + +# MightyMoose +*.mm.* +AutoTest.Net/ + +# Web workbench (sass) +.sass-cache/ + +# Installshield output folder +[Ee]xpress/ + +# DocProject is a documentation generator add-in +DocProject/buildhelp/ +DocProject/Help/*.HxT +DocProject/Help/*.HxC +DocProject/Help/*.hhc +DocProject/Help/*.hhk +DocProject/Help/*.hhp +DocProject/Help/Html2 +DocProject/Help/html + +# Click-Once directory +publish/ + +# Publish Web Output +*.[Pp]ublish.xml +*.azurePubxml +# Note: Comment the next line if you want to checkin your web deploy settings, +# but database connection strings (with potential passwords) will be unencrypted +*.pubxml +*.publishproj + +# Microsoft Azure Web App publish settings. Comment the next line if you want to +# checkin your Azure Web App publish settings, but sensitive information contained +# in these scripts will be unencrypted +PublishScripts/ + +# NuGet Packages +*.nupkg +# NuGet Symbol Packages +*.snupkg +# The packages folder can be ignored because of Package Restore +**/[Pp]ackages/* +# except build/, which is used as an MSBuild target. +!**/[Pp]ackages/build/ +# Uncomment if necessary however generally it will be regenerated when needed +#!**/[Pp]ackages/repositories.config +# NuGet v3's project.json files produces more ignorable files +*.nuget.props +*.nuget.targets + +# Microsoft Azure Build Output +csx/ +*.build.csdef + +# Microsoft Azure Emulator +ecf/ +rcf/ + +# Windows Store app package directories and files +AppPackages/ +BundleArtifacts/ +Package.StoreAssociation.xml +_pkginfo.txt +*.appx +*.appxbundle +*.appxupload + +# Visual Studio cache files +# files ending in .cache can be ignored +*.[Cc]ache +# but keep track of directories ending in .cache +!?*.[Cc]ache/ + +# Others +ClientBin/ +~$* +*~ +*.dbmdl +*.dbproj.schemaview +*.jfm +*.pfx +*.publishsettings +orleans.codegen.cs + +# Including strong name files can present a security risk +# (https://github.com/github/gitignore/pull/2483#issue-259490424) +#*.snk + +# Since there are multiple workflows, uncomment next line to ignore bower_components +# (https://github.com/github/gitignore/pull/1529#issuecomment-104372622) +#bower_components/ + +# RIA/Silverlight projects +Generated_Code/ + +# Backup & report files from converting an old project file +# to a newer Visual Studio version. Backup files are not needed, +# because we have git ;-) +_UpgradeReport_Files/ +Backup*/ +UpgradeLog*.XML +UpgradeLog*.htm +ServiceFabricBackup/ +*.rptproj.bak + +# SQL Server files +*.mdf +*.ldf +*.ndf + +# Business Intelligence projects +*.rdl.data +*.bim.layout +*.bim_*.settings +*.rptproj.rsuser +*- [Bb]ackup.rdl +*- [Bb]ackup ([0-9]).rdl +*- [Bb]ackup ([0-9][0-9]).rdl + +# Microsoft Fakes +FakesAssemblies/ + +# GhostDoc plugin setting file +*.GhostDoc.xml + +# Node.js Tools for Visual Studio +.ntvs_analysis.dat +node_modules/ + +# Visual Studio 6 build log +*.plg + +# Visual Studio 6 workspace options file +*.opt + +# Visual Studio 6 auto-generated workspace file (contains which files were open etc.) +*.vbw + +# Visual Studio LightSwitch build output +**/*.HTMLClient/GeneratedArtifacts +**/*.DesktopClient/GeneratedArtifacts +**/*.DesktopClient/ModelManifest.xml +**/*.Server/GeneratedArtifacts +**/*.Server/ModelManifest.xml +_Pvt_Extensions + +# Paket dependency manager +.paket/paket.exe +paket-files/ + +# FAKE - F# Make +.fake/ + +# CodeRush personal settings +.cr/personal + +# Python Tools for Visual Studio (PTVS) +__pycache__/ +*.pyc + +# Cake - Uncomment if you are using it +# tools/** +# !tools/packages.config + +# Tabs Studio +*.tss + +# Telerik's JustMock configuration file +*.jmconfig + +# BizTalk build output +*.btp.cs +*.btm.cs +*.odx.cs +*.xsd.cs + +# OpenCover UI analysis results +OpenCover/ + +# Azure Stream Analytics local run output +ASALocalRun/ + +# MSBuild Binary and Structured Log +*.binlog + +# NVidia Nsight GPU debugger configuration file +*.nvuser + +# MFractors (Xamarin productivity tool) working folder +.mfractor/ + +# Local History for Visual Studio +.localhistory/ + +# BeatPulse healthcheck temp database +healthchecksdb + +# Backup folder for Package Reference Convert tool in Visual Studio 2017 +MigrationBackup/ + +# Ionide (cross platform F# VS Code tools) working folder +.ionide/ + +# Fody - auto-generated XML schema +FodyWeavers.xsd + +## +## Visual studio for Mac +## + + +# globs +Makefile.in +*.userprefs +*.usertasks +config.make +config.status +aclocal.m4 +install-sh +autom4te.cache/ +*.tar.gz +tarballs/ +test-results/ + +# Mac bundle stuff +*.dmg +*.app + +# content below from: https://github.com/github/gitignore/blob/master/Global/macOS.gitignore +# General +.DS_Store +.AppleDouble +.LSOverride + +# Icon must end with two \r +Icon + + +# Thumbnails +._* + +# Files that might appear in the root of a volume +.DocumentRevisions-V100 +.fseventsd +.Spotlight-V100 +.TemporaryItems +.Trashes +.VolumeIcon.icns +.com.apple.timemachine.donotpresent + +# Directories potentially created on remote AFP share +.AppleDB +.AppleDesktop +Network Trash Folder +Temporary Items +.apdisk + +# content below from: https://github.com/github/gitignore/blob/master/Global/Windows.gitignore +# Windows thumbnail cache files +Thumbs.db +ehthumbs.db +ehthumbs_vista.db + +# Dump file +*.stackdump + +# Folder config file +[Dd]esktop.ini + +# Recycle Bin used on file shares +$RECYCLE.BIN/ + +# Windows Installer files +*.cab +*.msi +*.msix +*.msm +*.msp + +# Windows shortcuts +*.lnk + +# JetBrains Rider +.idea/ +*.sln.iml + +## +## Visual Studio Code +## +.vscode/* +!.vscode/settings.json +!.vscode/tasks.json +!.vscode/launch.json +!.vscode/extensions.json + +## +## Umbraco CMS +## + +# JSON schema files for appsettings.json +appsettings-schema.json +appsettings-schema.*.json + +# JSON schema file for umbraco-package.json +umbraco-package-schema.json + +# Packages created from the backoffice (package.xml/package.zip) +/umbraco/Data/CreatedPackages/ + +# Temp folder containing Examine indexes, NuCache, MediaCache, etc. +/umbraco/Data/TEMP/ + +# SQLite database files +/umbraco/Data/*.sqlite.db +/umbraco/Data/*.sqlite.db-shm +/umbraco/Data/*.sqlite.db-wal + +# Log files +/umbraco/Logs/ + +# Media files +#/wwwroot/media/ diff --git a/Our.Umbraco.TagHelpers.TestSite/Controllers/ContactFormController.cs b/Our.Umbraco.TagHelpers.TestSite/Controllers/ContactFormController.cs new file mode 100644 index 0000000..bac12a0 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Controllers/ContactFormController.cs @@ -0,0 +1,37 @@ +using Microsoft.AspNetCore.Mvc; +using Our.Umbraco.TagHelpers.TestSite.Models; +using Umbraco.Cms.Core.Cache; +using Umbraco.Cms.Core.Logging; +using Umbraco.Cms.Core.Routing; +using Umbraco.Cms.Core.Services; +using Umbraco.Cms.Core.Web; +using Umbraco.Cms.Infrastructure.Persistence; +using Umbraco.Cms.Web.Website.Controllers; + +namespace Our.Umbraco.TagHelpers.TestSite.Controllers; + +public class ContactFormController : SurfaceController +{ + public ContactFormController( + IUmbracoContextAccessor umbracoContextAccessor, + IUmbracoDatabaseFactory databaseFactory, + ServiceContext services, + AppCaches appCaches, + IProfilingLogger profilingLogger, + IPublishedUrlProvider publishedUrlProvider) + : base(umbracoContextAccessor, databaseFactory, services, appCaches, profilingLogger, publishedUrlProvider) + { + } + + [HttpPost] + public IActionResult Submit(ContactFormViewModel model) + { + if (!ModelState.IsValid) + { + return CurrentUmbracoPage(); + } + + // Send out an email or save to a DB table or CRM system etc... + return RedirectToCurrentUmbracoPage(); + } +} \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Models/ContactFormViewModel.cs b/Our.Umbraco.TagHelpers.TestSite/Models/ContactFormViewModel.cs new file mode 100644 index 0000000..7199554 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Models/ContactFormViewModel.cs @@ -0,0 +1,17 @@ +using System.ComponentModel.DataAnnotations; + +namespace Our.Umbraco.TagHelpers.TestSite.Models; + +public class ContactFormViewModel +{ + [Required] + public string Name { get; set; } + + [Required] + [EmailAddress] + public string Email { get; set; } + + [Required] + [MinLength(5)] + public string Message { get; set; } +} \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Our.Umbraco.TagHelpers.ExampleSite.csproj b/Our.Umbraco.TagHelpers.TestSite/Our.Umbraco.TagHelpers.TestSite.csproj similarity index 63% rename from Our.Umbraco.TagHelpers.ExampleSite/Our.Umbraco.TagHelpers.ExampleSite.csproj rename to Our.Umbraco.TagHelpers.TestSite/Our.Umbraco.TagHelpers.TestSite.csproj index 3204b52..0e991d3 100644 --- a/Our.Umbraco.TagHelpers.ExampleSite/Our.Umbraco.TagHelpers.ExampleSite.csproj +++ b/Our.Umbraco.TagHelpers.TestSite/Our.Umbraco.TagHelpers.TestSite.csproj @@ -1,30 +1,37 @@ - - - net6.0 - enable - enable - - - - - - - - - - - - - - - - true - - - - - false - false - - - + + + net9.0 + enable + enable + false + + + + + + + + + + + + + + + + + + + + + + true + + + + + false + false + + + diff --git a/Our.Umbraco.TagHelpers.TestSite/Program.cs b/Our.Umbraco.TagHelpers.TestSite/Program.cs new file mode 100644 index 0000000..8d36c2b --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Program.cs @@ -0,0 +1,26 @@ +WebApplicationBuilder builder = WebApplication.CreateBuilder(args); + +builder.CreateUmbracoBuilder() + .AddBackOffice() + .AddWebsite() + .AddComposers() + .Build(); + +WebApplication app = builder.Build(); + +await app.BootUmbracoAsync(); + + +app.UseUmbraco() + .WithMiddleware(u => + { + u.UseBackOffice(); + u.UseWebsite(); + }) + .WithEndpoints(u => + { + u.UseBackOfficeEndpoints(); + u.UseWebsiteEndpoints(); + }); + +await app.RunAsync(); diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Properties/launchSettings.json b/Our.Umbraco.TagHelpers.TestSite/Properties/launchSettings.json similarity index 77% rename from Our.Umbraco.TagHelpers.ExampleSite/Properties/launchSettings.json rename to Our.Umbraco.TagHelpers.TestSite/Properties/launchSettings.json index b10cee2..1af5b8c 100644 --- a/Our.Umbraco.TagHelpers.ExampleSite/Properties/launchSettings.json +++ b/Our.Umbraco.TagHelpers.TestSite/Properties/launchSettings.json @@ -1,29 +1,29 @@ -{ - "$schema": "https://json.schemastore.org/launchsettings.json", - "iisSettings": { - "windowsAuthentication": false, - "anonymousAuthentication": true, - "iisExpress": { - "applicationUrl": "http://localhost:46843", - "sslPort": 44370 - } - }, - "profiles": { - "IIS Express": { - "commandName": "IISExpress", - "launchBrowser": true, - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - }, - "Umbraco.Web.UI": { - "commandName": "Project", - "dotnetRunMessages": true, - "launchBrowser": true, - "applicationUrl": "https://localhost:44370;http://localhost:46843", - "environmentVariables": { - "ASPNETCORE_ENVIRONMENT": "Development" - } - } - } -} +{ + "$schema": "https://json.schemastore.org/launchsettings.json", + "iisSettings": { + "windowsAuthentication": false, + "anonymousAuthentication": true, + "iisExpress": { + "applicationUrl": "http://localhost:30153", + "sslPort": 44302 + } + }, + "profiles": { + "IIS Express": { + "commandName": "IISExpress", + "launchBrowser": true, + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + }, + "Umbraco.Web.UI": { + "commandName": "Project", + "dotnetRunMessages": true, + "launchBrowser": true, + "applicationUrl": "https://localhost:44302;http://localhost:30153", + "environmentVariables": { + "ASPNETCORE_ENVIRONMENT": "Development" + } + } + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Home.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Home.cshtml new file mode 100644 index 0000000..4ddda1c --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Home.cshtml @@ -0,0 +1,68 @@ +@using Our.Umbraco.TagHelpers.TestSite.Models +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + Layout = "layout.cshtml"; +} + + + +
+ + + +
+ + + +
+ + + + +

Header Value: @Model.Value("header")

+
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ + + +
+ diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Page.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Page.cshtml new file mode 100644 index 0000000..44ce285 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Page.cshtml @@ -0,0 +1,10 @@ +@using Umbraco.Cms.Web.Common.PublishedModels; +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + Layout = "layout.cshtml"; +} + +

Page

+ + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/area.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/area.cshtml new file mode 100644 index 0000000..d7b3c69 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/area.cshtml @@ -0,0 +1,10 @@ +@using Umbraco.Extensions +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +
+ @await Html.GetBlockGridItemsHtmlAsync(Model) +
diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/areas.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/areas.cshtml new file mode 100644 index 0000000..cb89f3e --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/areas.cshtml @@ -0,0 +1,13 @@ +@using Umbraco.Extensions +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + if (Model?.Areas.Any() != true) { return; } +} + +
+ @foreach (var area in Model.Areas) + { + @await Html.GetBlockGridItemAreaHtmlAsync(area) + } +
diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/default.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/default.cshtml new file mode 100644 index 0000000..96285eb --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/default.cshtml @@ -0,0 +1,11 @@ +@using Umbraco.Extensions +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + if (Model?.Any() != true) { return; } +} + +
+ @await Html.GetBlockGridItemsHtmlAsync(Model) +
diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/items.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/items.cshtml new file mode 100644 index 0000000..745d4b6 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blockgrid/items.cshtml @@ -0,0 +1,36 @@ +@using Umbraco.Cms.Core.Models.Blocks +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage> +@{ + if (Model?.Any() != true) { return; } +} + +
+ @foreach (var item in Model) + { + +
+ @{ + var partialViewName = "blockgrid/Components/" + item.Content.ContentType.Alias; + try + { + @await Html.PartialAsync(partialViewName, item) + } + catch (InvalidOperationException) + { +

+ Could not render component of type: @(item.Content.ContentType.Alias) +
+ This likely happened because the partial view @partialViewName could not be found. +

+ } + } +
+ } +
diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/blocklist/default.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blocklist/default.cshtml similarity index 96% rename from Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/blocklist/default.cshtml rename to Our.Umbraco.TagHelpers.TestSite/Views/Partials/blocklist/default.cshtml index accca2e..7fc6813 100644 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/Partials/blocklist/default.cshtml +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/blocklist/default.cshtml @@ -1,13 +1,13 @@ -@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage -@{ - if (Model?.Any() != true) { return; } -} -
- @foreach (var block in Model) - { - if (block?.ContentUdi == null) { continue; } - var data = block.Content; - - @await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block) - } -
+@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + if (Model?.Any() != true) { return; } +} +
+ @foreach (var block in Model) + { + if (block?.ContentUdi == null) { continue; } + var data = block.Content; + + @await Html.PartialAsync("blocklist/Components/" + data.ContentType.Alias, block) + } +
diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/login-status.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/login-status.cshtml new file mode 100644 index 0000000..2baf424 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/login-status.cshtml @@ -0,0 +1,27 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +@using Microsoft.AspNetCore.Http.Extensions +@using Umbraco.Cms.Web.Common.Models +@using Umbraco.Cms.Web.Website.Controllers +@using Umbraco.Extensions + +@{ + var isLoggedIn = Context.User.GetMemberIdentity()?.IsAuthenticated ?? false; + var logoutModel = new PostRedirectModel(); + // You can modify this to redirect to a different URL instead of the current one + logoutModel.RedirectUrl = null; +} + +@if (isLoggedIn) +{ + +} \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/login.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/login.cshtml new file mode 100644 index 0000000..584af03 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/login.cshtml @@ -0,0 +1,108 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + + +@using Umbraco.Cms.Web.Common.Models +@using Umbraco.Cms.Web.Common.Security +@using Umbraco.Cms.Web.Website.Controllers +@using Umbraco.Cms.Core.Services +@using Umbraco.Extensions +@inject IMemberExternalLoginProviders memberExternalLoginProviders +@inject ITwoFactorLoginService twoFactorLoginService +@{ + var loginModel = new LoginModel(); + // You can modify this to redirect to a different URL instead of the current one + loginModel.RedirectUrl = null; +} + + + + + + +@if (ViewData.TryGetTwoFactorProviderNames(out var providerNames)) +{ + + foreach (var providerName in providerNames) + { +
+

Two factor with @providerName.

+
+ @using (Html.BeginUmbracoForm(nameof(UmbTwoFactorLoginController.Verify2FACode))) + { + + + + Input security code:
+ +
+
+ } +
+ } + +} +else +{ + + + +} \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/register.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/register.cshtml new file mode 100644 index 0000000..9c88c27 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/membership/register.cshtml @@ -0,0 +1,90 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +@using Microsoft.AspNetCore.Http.Extensions +@using Umbraco.Cms.Core +@using Umbraco.Cms.Core.Security +@using Umbraco.Cms.Web.Website.Controllers +@using Umbraco.Cms.Web.Website.Models +@using Umbraco.Extensions +@inject MemberModelBuilderFactory memberModelBuilderFactory; + +@{ + // Build a registration model with parameters + var registerModel = memberModelBuilderFactory + .CreateRegisterModel() + // Set the member type alias to use for the new member + .WithMemberTypeAlias(Constants.Conventions.MemberTypes.DefaultAlias) + // If null or not set, this will redirect to the current page + .WithRedirectUrl(null) + // Set to true if you want the member editable properties shown. + // It will only displays properties marked as "Member can edit" on the "Info" tab of the Member Type. + .WithCustomProperties(false) + // By default the member will be logged in automatically after registration. + // Set this to false if the member should not be logged in automatically. + .WithAutomaticLogIn(true) + .Build(); + + var success = TempData["FormSuccess"] != null; +} + + + + + +@if (success) +{ + @* This message will show if registerModel.RedirectUrl is not defined (default) *@ +

Registration succeeded.

+} +else +{ + using (Html.BeginUmbracoForm( + "HandleRegisterMember", + new { + MemberTypeAlias = registerModel.MemberTypeAlias, + UsernameIsEmail = registerModel.UsernameIsEmail, + RedirectUrl = registerModel.RedirectUrl, + AutomaticLogIn = registerModel.AutomaticLogIn + })) + { +

Create a new account.

+
+
+
+ + + +
+
+ + + +
+
+ + + +
+
+ + + +
+ + @if (registerModel.MemberProperties != null) + { + for (var i = 0; i < registerModel.MemberProperties.Count; i++) + { +
+ @Html.LabelFor(m => registerModel.MemberProperties[i].Value, registerModel.MemberProperties[i].Name) + + @Html.HiddenFor(m => registerModel.MemberProperties[i].Alias) + +
+ } + } + + + + } +} \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/SurfaceControllerForm.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/SurfaceControllerForm.cshtml new file mode 100644 index 0000000..17936a7 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/SurfaceControllerForm.cshtml @@ -0,0 +1,33 @@ +@using Our.Umbraco.TagHelpers.TestSite.Models +@model ContactFormViewModel + +

Replacement for BeginUmbracoForm

+

+ This is to make it easier to create a HTML form that uses an Umbraco SurfaceController + and would be an alternative of using the Html.BeginUmbracoForm approach. + This taghelper runs against the form element along with these attributes our-controller + and our-action to help generate a hidden input field of ufprt containing + the encoded path that this form needs to route to. +

+ +
+
+ +
+

Name:

+ + +
+
+

Email:

+ + +
+
+

Message:

+ + +
+
+ +
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-active-class.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-active-class.cshtml new file mode 100644 index 0000000..c5a81f7 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-active-class.cshtml @@ -0,0 +1,17 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +

our-active-class

+ +@foreach (var item in Model.Root().Children) +{ + @item.Name +} + +
    + @foreach (var item in Model.Root().Children) + { +
  • + @item.Name +
  • + } +
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-cache.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-cache.cshtml new file mode 100644 index 0000000..bc1fe56 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-cache.cshtml @@ -0,0 +1,27 @@ +

our-cache

+

+ All examples will skip the cache for Umbraco preview mode + and debug mode, and evict cache items anytime Umbraco publishes content, media or dictionary items. +

+ + +

@DateTime.Now - A set Date in time

+
+ + +

@DateTime.Now - Every 120 seconds (2minutes)

+
+ + + + + + +

+ This example will turn off the automatic clearing of the tag helper + cache if 'any page' is published, but still clear the cache if the individual page is published: +

+ + +

@DateTime.Now - A set Date in time

+
diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-dictionary.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-dictionary.cshtml new file mode 100644 index 0000000..15c1f80 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-dictionary.cshtml @@ -0,0 +1,16 @@ +

our-dictionary

+

+ This is a tag helper element our-dictionary that will use the current page's + request Language/Culture to use a dictionary translation from the Umbraco translation section. +

+
    +
  • Find dictionary key
  • +
  • Find translation for Current Culture/Language of the page
  • +
  • If no translation found see if we have fallback attribute set fallback-lang or umb-dictionary-fallback-lang
  • +
  • Attempt to find dictionary item for that ISO language fallback
  • +
  • No translation found - leave default/value inside tag untouched for final fallback
  • +
+ +

My Header

+

Value does not exist in EN

+

I will render as no key exists

\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-edit-link.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-edit-link.cshtml new file mode 100644 index 0000000..f3fbdcf --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-edit-link.cshtml @@ -0,0 +1,22 @@ +

our-edit-link

+

+ This is a tag helper element which renders an edit link on the front end only if the current user is logged into umbraco and has access to the content section. +

+

+ The link will open the current page in the umbraco backoffice. You can override the umbraco url if you are using a different url for the backoffice. +

+ +
+ Edit this Page +
+ +
+ Edit this Page in new tab +
+ +
+ Edit a specific page that not itself +
+ + +Edit down bottom left \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-fallback.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-fallback.cshtml new file mode 100644 index 0000000..19c5e83 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-fallback.cshtml @@ -0,0 +1,15 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + + +

our-fallback

+

+ This tag helper element our-fallback uses the same fallback mode logic + that is only available on the Value() method of the IPublishedContent interface + that uses a string for the property name to lookup. + In addition if the fallback value from a language or ancestors is not + available we are still able to fallback to the content inside the tag. +

+ + +

I do have a DA culture variant of this property and this should be replaced

+

I do NOT have a da-DK culture variant of this property

\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-if.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-if.cshtml new file mode 100644 index 0000000..4c913fd --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-if.cshtml @@ -0,0 +1,9 @@ +

our-if

+

+ This is a tag helper attribute that can be applied to any DOM element + in the razor template or partial. It will include its element and children + on the page if the expression inside the our-if attribute evaluates to true. +

+ +
This will only render during even minutes.
+
This will only render during odd minutes.
diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-img.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-img.cshtml new file mode 100644 index 0000000..1599a84 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-img.cshtml @@ -0,0 +1,110 @@ +

our-img

+ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + +
ExampleCodeRendered Image
+

Basic Media Item

+ Auto alt text, width & height, native lazy loading +
+ Input: +
+<our-img media-item="Model.Image" />
+
+ Output: +
+<img alt="Some alt text" width="1920" height="1280" 
+     src="/media/path/image.jpg?width=1920&rnd=133087885756657361" 
+     loading="lazy" decoding="async" fetchpriority="low">
+
+
+ +
+

Simple Scaled Media With Custom Alt Text

+ Eager loading, high fetch priority +
+ Input: +
+<our-img media-item="Model.Image" 
+          width="200" 
+          alt="Custom Alt Text" 
+          abovethefold="true" />
+
+ Output: +
+<img alt="Custom Alt Text" width="200" height="133.33" 
+     src="/media/path/image.jpg?width=200&rnd=133087885756657361" 
+     loading="eager" fetchpriority="high">
+
+
+ +
+

Responsive with Crops

+ Outputs <picture> with responsive <source> tags and auto alt +
+ Input: +
+<our-img media-item="Model.Image" 
+          width="200" 
+          width--s="400" 
+          width--m="600" 
+          cropalias="mobile" 
+          cropalias--m="desktop" />
+
+ Output: +
+<picture>
+    <source srcset="/media/path/image.jpg?width=600&height=300" media="(min-width: 768px)" width="600" height="300">
+    <source srcset="/media/path/image.jpg?width=400&height=400" media="(min-width: 576px)" width="400" height="400">
+    <img alt="Some alt text" width="200" height="200" 
+         src="/media/path/image.jpg?width=200&height=200" 
+         loading="lazy" decoding="async" fetchpriority="low">
+</picture>
+
+
+ +
+ +
+

Notes

+
    +
  • The rendered images reflect the appsettings.json configurations for lazy loading, breakpoints, and aspect ratios.
  • +
  • Resize your browser window to see responsive <picture> sources kick in for the last example.
  • +
  • The alt text is automatically pulled from media properties unless overridden.
  • +
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-lang-switcher.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-lang-switcher.cshtml new file mode 100644 index 0000000..765acdf --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-lang-switcher.cshtml @@ -0,0 +1,23 @@ +

our-lang-switcher

+

+ This tag helper element our-lang-switcher will create a simple unordered + list of all languages and domains, in order to create a simple language switcher. + As this produces a lot of HTML markup that is opinionated with certain + class names and elements, you may wish to change and control the markup it produces. +

+

+ With this tag helper the child DOM elements inside the our-lang-switcher + element is used as a Mustache templating language to control the markup. +

+ + +
+ {{#Languages}} +
+ {{Name}} +
+ {{/Languages}} +
+
+ + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-link.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-link.cshtml new file mode 100644 index 0000000..d4c241d --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-link.cshtml @@ -0,0 +1,27 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +

our-link

+ + +

Hi There

+
+ + + + + Some text tha will fallback to wrapping div with a span inside + + +@* No link will result in *@ +@* +
+ some text +
+*@ + + + Some text tha will fallback to span + + +@*No link and no fallback HTML tag name specified will result in*@ +@* some text *@ \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-member-include-exclude.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-member-include-exclude.cshtml new file mode 100644 index 0000000..0b8fa1b --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-member-include-exclude.cshtml @@ -0,0 +1,29 @@ +

our-member-include and our-member-exclude

+

+ This is a tag helper attribute that can be applied to any DOM element in the razor template or partial. It will show or hide its element and children on the page when passing a comma seperated string of member groups that the current logged in member is in, for the exclude or include variants. +

+

+ There are two special Member Groups you can use: +

+
    +
  • * - All anonymous users
  • +
  • ? - All authenticated users
  • +
  • Use the alias of the Member Group
  • +
+ +

Include

+
Only members of ✅ Staff Member Group will see this.
+
Only members of ✅ Staff OR ✅ Admins member group will see this.
+
Only ✅ Anonymous members will see this.
+
Only ✅ logged in members will see this.
+ +

Exclude

+
Everyone except ❌ Staff members can see this.
+
Everyone except ❌ Anonymous users will see this.
+
Everyone except ❌ logged in users will see this.
+ +
+ + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-self-host.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-self-host.cshtml new file mode 100644 index 0000000..f01a068 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-self-host.cshtml @@ -0,0 +1,45 @@ +

our-self-host

+

+ This is a tag helper attribute that can be applied to any element using + a src or href attribute in the razor template or partial. + It will automatically download and self hosting of + third party assets, like javascript, css or images. + This was written by Soren Kottal for 24Days.in + Umbraco Advent calendar 2022 article - https://24days.in/umbraco-cms/2022/static-assets-taghelper/ +

+ +

Simple Example

+

+ This will download the linked file to your local filesystem, and swap out + the src attribute with a reference to the now locally hosted file. +

+ + + +

Folder location for downloaded files

+

+ By default the files will be saved in /assets/, and keep the folder path of the url. + The root folder can be configured in appsettings.json, by adding a value at + Our.Umbraco.TagHelpers:OurSelfHost:RootFolder specifying + the desired rootfolder. The default value is /assets/. +

+

+ You can further divide the files into folders, by adding a folder attribute to the script tag, eg: +

+ + +

Handling extensionless urls to files

+

+ In case the url is extensionless, like https://unpkg.com/alpinejs, + you can add an ext attribute, for specifying the extension of the file, eg: +

+ +

+ This will save the file as /assets/alpinejs.js, enabling eg. MIME types for .js files. +

+ +

Caching

+

+ The file is saved once, and never updated unless you manually remove the file. + The lookup for the local file is cached in the Runtime Cache. +

\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-svg.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-svg.cshtml new file mode 100644 index 0000000..d044e3e --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-svg.cshtml @@ -0,0 +1,22 @@ +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage + +

our-svg

+

+ This tag helper element our-svg will read the file contents of an SVG file and + output it as an inline SVG in the DOM. It can be used in one of two ways, either + by specifying the src attribute to a physical static file served from wwwRoot + or by specifying the media-item attribute to use a picked IPublishedContent Media Item. +

+ + +
+ +
+ +
+ +
+ +
    +
  • TODO: With Cache
  • +
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-user-include-exclude.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-user-include-exclude.cshtml new file mode 100644 index 0000000..1ad9795 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-user-include-exclude.cshtml @@ -0,0 +1,25 @@ +

our-user-include and our-user-exclude

+

+ This is a tag helper attribute that can be applied to any DOM element in the razor template or partial. It will show or hide its element and children on the page when passing a comma seperated string of user groups that the current logged in Umbraco backoffice user is in, for the exclude or include variants. +

+

+ There are two special User Groups you can use: +

+
    +
  • * - All anonymous users
  • +
  • ? - All authenticated users
  • +
  • Use the alias of the User Group
  • +
+ +

Include

+
Only users in the ✅ Admin group will see this.
+
Only users in the ✅ Admin or ✅ Editor user group will see this.
+
Only ✅ Anonymous users will see this.
+
Only ✅ logged in users will see this.
+ + +

Exclude

+
Everyone except ❌ Editor users can see this.
+
Everyone except ❌ Admin or ❌ Editor users can see this.
+
Everyone except ❌ Anonymous users will see this.
+
Everyone except ❌ logged in users will see this.
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-version.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-version.cshtml new file mode 100644 index 0000000..f072c99 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/Partials/taghelper-samples/our-version.cshtml @@ -0,0 +1,15 @@ +

our-version

+

+ This tag helper element our-version prints out version number for a given Assembly + name loaded into the current AppDomain or if none is given then the EntryAssembly + version is displayed, which would be the Umbraco website project you are building. +

+ + +
    + +
  • Website Project Assembly Version:
  • +
  • Our.Umbraco.Taghelpers:
  • +
  • Umbraco.Core:
  • +
  • Non existent:
  • +
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.ExampleSite/Views/_ViewImports.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/_ViewImports.cshtml similarity index 72% rename from Our.Umbraco.TagHelpers.ExampleSite/Views/_ViewImports.cshtml rename to Our.Umbraco.TagHelpers.TestSite/Views/_ViewImports.cshtml index b0a4298..e87764e 100644 --- a/Our.Umbraco.TagHelpers.ExampleSite/Views/_ViewImports.cshtml +++ b/Our.Umbraco.TagHelpers.TestSite/Views/_ViewImports.cshtml @@ -1,11 +1,7 @@ -@using Umbraco.Extensions -@using Our.Umbraco.TagHelpers.ExampleSite -@using Umbraco.Cms.Web.Common.PublishedModels -@using Umbraco.Cms.Web.Common.Views -@using Umbraco.Cms.Core.Models.PublishedContent -@using Microsoft.AspNetCore.Html -@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers -@addTagHelper *, Smidge -@inject Smidge.SmidgeHelper SmidgeHelper - +@using Umbraco.Extensions +@using Umbraco.Cms.Web.Common.PublishedModels +@using Umbraco.Cms.Web.Common.Views +@using Umbraco.Cms.Core.Models.PublishedContent +@using Microsoft.AspNetCore.Html +@addTagHelper *, Microsoft.AspNetCore.Mvc.TagHelpers @addTagHelper *, Our.Umbraco.TagHelpers \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/Views/layout.cshtml b/Our.Umbraco.TagHelpers.TestSite/Views/layout.cshtml new file mode 100644 index 0000000..65a0cc2 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/Views/layout.cshtml @@ -0,0 +1,18 @@ +@using Umbraco.Cms.Web.Common.PublishedModels; +@inherits Umbraco.Cms.Web.Common.Views.UmbracoViewPage +@{ + Layout = null; +} + + + + + + + + + +

Umbraco TagHelpers Test Site

+ @RenderBody() + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/appsettings.Development.json b/Our.Umbraco.TagHelpers.TestSite/appsettings.Development.json new file mode 100644 index 0000000..5cf407f --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/appsettings.Development.json @@ -0,0 +1,40 @@ +{ + "$schema": "appsettings-schema.json", + "Serilog": { + "MinimumLevel": { + "Default": "Information" + }, + "WriteTo": [ + { + "Name": "Async", + "Args": { + "configure": [ + { + "Name": "Console" + } + ] + } + } + ] + }, + "ConnectionStrings": { + "umbracoDbDSN": "Data Source=|DataDirectory|/Umbraco.sqlite.db;Cache=Shared;Foreign Keys=True;Pooling=True", + "umbracoDbDSN_ProviderName": "Microsoft.Data.Sqlite" + }, + "Umbraco": { + "CMS": { + "Unattended": { + "InstallUnattended": true, + "UnattendedUserName": "Warren Buckley", + "UnattendedUserEmail": "warren@hackmakedo.com", + "UnattendedUserPassword": "password1234" + }, + "Content": { + "MacroErrors": "Throw" + }, + "Hosting": { + "Debug": true + } + } + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/appsettings.json b/Our.Umbraco.TagHelpers.TestSite/appsettings.json new file mode 100644 index 0000000..9bf8f66 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/appsettings.json @@ -0,0 +1,37 @@ +{ + "$schema": "appsettings-schema.json", + "Serilog": { + "MinimumLevel": { + "Default": "Information", + "Override": { + "Microsoft": "Warning", + "Microsoft.Hosting.Lifetime": "Information", + "System": "Warning" + } + } + }, + "Umbraco": { + "CMS": { + "Global": { + "Id": "8121ba9e-8457-4b2e-8d51-e02b1f5a8c1a", + "SanitizeTinyMce": true + }, + "Content": { + "AllowEditInvariantFromNonDefault": true, + "ContentVersionCleanupPolicy": { + "EnableCleanup": true + } + }, + "Unattended": { + "UpgradeUnattended": true + }, + "Security": { + "AllowConcurrentLogins": false + }, + "ModelsBuilder": { + "ModelsMode": "SourceCodeManual", + "IncludeVersionNumberInGeneratedModels": false + } + } + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/home.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/home.config new file mode 100644 index 0000000..2254557 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/home.config @@ -0,0 +1,89 @@ + + + + + /Home + false + home + 2025-08-24T19:45:00 + + Home DA + Home + Home ES + + 0 + + true + true + true + + + + + + + + + + + +
+ + + +
+ + + + + + +
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-a.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-a.config new file mode 100644 index 0000000..756a9eb --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-a.config @@ -0,0 +1,20 @@ + + + + Home + /Home/PageA + false + page + 2025-09-08T21:20:06 + + 0 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-aa.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-aa.config new file mode 100644 index 0000000..f2dfce5 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-aa.config @@ -0,0 +1,20 @@ + + + + Page A + /Home/PageA/PageAA + false + page + 2025-09-08T21:20:30 + + 0 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ab.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ab.config new file mode 100644 index 0000000..3f9e4df --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ab.config @@ -0,0 +1,20 @@ + + + + Page A + /Home/PageA/PageAB + false + page + 2025-09-08T21:20:39 + + 1 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-b.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-b.config new file mode 100644 index 0000000..66d7eb5 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-b.config @@ -0,0 +1,20 @@ + + + + Home + /Home/PageB + false + page + 2025-09-08T21:20:20 + + 1 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ba.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ba.config new file mode 100644 index 0000000..04a8a8f --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ba.config @@ -0,0 +1,20 @@ + + + + Page B + /Home/PageB/PageBA + false + page + 2025-09-08T21:20:49 + + 0 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-c.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-c.config new file mode 100644 index 0000000..c639f4c --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-c.config @@ -0,0 +1,20 @@ + + + + Home + /Home/PageC + false + page + 2025-09-08T21:21:01 + + 2 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ca.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ca.config new file mode 100644 index 0000000..8c09af5 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-ca.config @@ -0,0 +1,20 @@ + + + + Page C + /Home/PageC/PageCA + false + page + 2025-09-08T21:21:09 + + 0 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-caa.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-caa.config new file mode 100644 index 0000000..94b3a63 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Content/page-caa.config @@ -0,0 +1,20 @@ + + + + Page CA + /Home/PageC/PageCA/PageCAA + false + page + 2025-09-08T21:21:20 + + 0 + + + + + +
+ +
+
+
\ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/ContentTypes/home.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/ContentTypes/home.config new file mode 100644 index 0000000..299412c --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/ContentTypes/home.config @@ -0,0 +1,117 @@ + + + + Home + icon-home + folder.png + + True + 00000000-0000-0000-0000-000000000000 + Culture + false + + False + + + + + Home + + + + + + page + + + + 5f09c1ad-95a9-46b1-8d48-26d245f008ad + CTA Link + ctaLink + 2cd9d921-e7d0-4c9e-b4c7-b5d00789b8f6 + Umbraco.MultiUrlPicker + false + + + 2 + Content + Nothing + + + false + + + 13a4b430-5632-48d8-a84a-aa673f701cd4 + Empty Link + emptyLink + 2cd9d921-e7d0-4c9e-b4c7-b5d00789b8f6 + Umbraco.MultiUrlPicker + false + + + 3 + Content + Nothing + + + false + + + 76ade800-b604-4037-a799-e4720221b375 + Header + header + 0cc0eba1-9960-42c9-bf9b-60e150b429ae + Umbraco.TextBox + false + + + 0 + Content + Culture + + + false + + + b17df61e-7b15-4304-8d8f-476998055b58 + Image + image + ad9f0cf2-bda2-45d5-9ea1-a63cfc873fd3 + Umbraco.MediaPicker3 + false + + + 4 + Content + Nothing + + + false + + + de814e26-3189-4c64-8a3c-08729f45ad5b + Logo + logo + 1ca6d1fb-bb47-47e4-88ce-9c3759ac50fa + Umbraco.MediaPicker3 + false + + + 1 + Content + Nothing + + + false + + + + + 5c4bf9fa-64e7-41ad-b0ec-f11416ded89c + Content + content + Tab + 0 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/ContentTypes/page.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/ContentTypes/page.config new file mode 100644 index 0000000..f2e76e0 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/ContentTypes/page.config @@ -0,0 +1,53 @@ + + + + Page + icon-document-html + folder.png + A generic page + False + 00000000-0000-0000-0000-000000000000 + Nothing + false + + False + + + + + Page + + + + + + page + + + + f7958510-aca1-4b31-87d6-1d1c1f18e0bf + Header + header + 0cc0eba1-9960-42c9-bf9b-60e150b429ae + Umbraco.TextBox + false + + + 0 + Content + Nothing + + + false + + + + + 978e4ad1-00c1-43ea-a4e6-81f499798c0a + Content + content + Group + 0 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ApprovedColor.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ApprovedColor.config new file mode 100644 index 0000000..48af8bf --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ApprovedColor.config @@ -0,0 +1,9 @@ + + + + Approved Color + Umbraco.ColorPicker + Umb.PropertyEditorUi.ColorPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/CheckboxList.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/CheckboxList.config new file mode 100644 index 0000000..9d16d85 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/CheckboxList.config @@ -0,0 +1,9 @@ + + + + Checkbox list + Umbraco.CheckBoxList + Umb.PropertyEditorUi.CheckBoxList + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ContentPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ContentPicker.config new file mode 100644 index 0000000..4857d0f --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ContentPicker.config @@ -0,0 +1,9 @@ + + + + Content Picker + Umbraco.ContentPicker + Umb.PropertyEditorUi.DocumentPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DatePicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DatePicker.config new file mode 100644 index 0000000..a9ccd30 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DatePicker.config @@ -0,0 +1,11 @@ + + + + Date Picker + Umbraco.DateTime + Umb.PropertyEditorUi.DatePicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DatePickerWithTime.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DatePickerWithTime.config new file mode 100644 index 0000000..411b082 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DatePickerWithTime.config @@ -0,0 +1,11 @@ + + + + Date Picker with time + Umbraco.DateTime + Umb.PropertyEditorUi.DatePicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Dropdown.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Dropdown.config new file mode 100644 index 0000000..f7034ad --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Dropdown.config @@ -0,0 +1,11 @@ + + + + Dropdown + Umbraco.DropDown.Flexible + Umb.PropertyEditorUi.Dropdown + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DropdownMultiple.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DropdownMultiple.config new file mode 100644 index 0000000..b80c7a0 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/DropdownMultiple.config @@ -0,0 +1,11 @@ + + + + Dropdown multiple + Umbraco.DropDown.Flexible + Umb.PropertyEditorUi.Dropdown + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ImageCropper.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ImageCropper.config new file mode 100644 index 0000000..13240ff --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ImageCropper.config @@ -0,0 +1,9 @@ + + + + Image Cropper + Umbraco.ImageCropper + Umb.PropertyEditorUi.ImageCropper + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ImageMediaPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ImageMediaPicker.config new file mode 100644 index 0000000..8587f80 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ImageMediaPicker.config @@ -0,0 +1,30 @@ + + + + Image Media Picker + Umbraco.MediaPicker3 + Umb.PropertyEditorUi.MediaPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelBigint.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelBigint.config new file mode 100644 index 0000000..81353bd --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelBigint.config @@ -0,0 +1,11 @@ + + + + Label (bigint) + Umbraco.Label + Umb.PropertyEditorUi.Label + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelDatetime.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelDatetime.config new file mode 100644 index 0000000..2d2a1e5 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelDatetime.config @@ -0,0 +1,11 @@ + + + + Label (datetime) + Umbraco.Label + Umb.PropertyEditorUi.Label + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelDecimal.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelDecimal.config new file mode 100644 index 0000000..34236c7 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelDecimal.config @@ -0,0 +1,11 @@ + + + + Label (decimal) + Umbraco.Label + Umb.PropertyEditorUi.Label + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelInteger.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelInteger.config new file mode 100644 index 0000000..31f409c --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelInteger.config @@ -0,0 +1,11 @@ + + + + Label (integer) + Umbraco.Label + Umb.PropertyEditorUi.Label + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelString.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelString.config new file mode 100644 index 0000000..b8ab10c --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelString.config @@ -0,0 +1,11 @@ + + + + Label (string) + Umbraco.Label + Umb.PropertyEditorUi.Label + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelTime.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelTime.config new file mode 100644 index 0000000..dd0438b --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/LabelTime.config @@ -0,0 +1,11 @@ + + + + Label (time) + Umbraco.Label + Umb.PropertyEditorUi.Label + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ListViewContent.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ListViewContent.config new file mode 100644 index 0000000..577dee9 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ListViewContent.config @@ -0,0 +1,41 @@ + + + + List View - Content + Umbraco.ListView + Umb.PropertyEditorUi.Collection + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ListViewMedia.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ListViewMedia.config new file mode 100644 index 0000000..2fca8c8 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/ListViewMedia.config @@ -0,0 +1,41 @@ + + + + List View - Media + Umbraco.ListView + Umb.PropertyEditorUi.Collection + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MediaPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MediaPicker.config new file mode 100644 index 0000000..35f90a4 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MediaPicker.config @@ -0,0 +1,15 @@ + + + + Media Picker + Umbraco.MediaPicker3 + Umb.PropertyEditorUi.MediaPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MemberPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MemberPicker.config new file mode 100644 index 0000000..0f79e0e --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MemberPicker.config @@ -0,0 +1,9 @@ + + + + Member Picker + Umbraco.MemberPicker + Umb.PropertyEditorUi.MemberPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultiURLPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultiURLPicker.config new file mode 100644 index 0000000..5e50299 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultiURLPicker.config @@ -0,0 +1,9 @@ + + + + Multi URL Picker + Umbraco.MultiUrlPicker + Umb.PropertyEditorUi.MultiUrlPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultipleImageMediaPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultipleImageMediaPicker.config new file mode 100644 index 0000000..6c390d0 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultipleImageMediaPicker.config @@ -0,0 +1,12 @@ + + + + Multiple Image Media Picker + Umbraco.MediaPicker3 + Umb.PropertyEditorUi.MediaPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultipleMediaPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultipleMediaPicker.config new file mode 100644 index 0000000..f0cbee5 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/MultipleMediaPicker.config @@ -0,0 +1,11 @@ + + + + Multiple Media Picker + Umbraco.MediaPicker3 + Umb.PropertyEditorUi.MediaPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Numeric.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Numeric.config new file mode 100644 index 0000000..d411273 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Numeric.config @@ -0,0 +1,9 @@ + + + + Numeric + Umbraco.Integer + Umb.PropertyEditorUi.Integer + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Radiobox.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Radiobox.config new file mode 100644 index 0000000..4f3fa7e --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Radiobox.config @@ -0,0 +1,9 @@ + + + + Radiobox + Umbraco.RadioButtonList + Umb.PropertyEditorUi.RadioButtonList + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/RichtextEditor.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/RichtextEditor.config new file mode 100644 index 0000000..a3d32fe --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/RichtextEditor.config @@ -0,0 +1,57 @@ + + + + Richtext editor + Umbraco.RichText + Umb.PropertyEditorUi.Tiptap + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/SVGMediaPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/SVGMediaPicker.config new file mode 100644 index 0000000..e3cd52a --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/SVGMediaPicker.config @@ -0,0 +1,14 @@ + + + + SVG Media Picker + Umbraco.MediaPicker3 + Umb.PropertyEditorUi.MediaPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/SingleURLPicker.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/SingleURLPicker.config new file mode 100644 index 0000000..7284d03 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/SingleURLPicker.config @@ -0,0 +1,12 @@ + + + + Single URL Picker + Umbraco.MultiUrlPicker + Umb.PropertyEditorUi.MultiUrlPicker + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Tags.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Tags.config new file mode 100644 index 0000000..2209206 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Tags.config @@ -0,0 +1,12 @@ + + + + Tags + Umbraco.Tags + Umb.PropertyEditorUi.Tags + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Textarea.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Textarea.config new file mode 100644 index 0000000..8b4b971 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Textarea.config @@ -0,0 +1,9 @@ + + + + Textarea + Umbraco.TextArea + Umb.PropertyEditorUi.TextArea + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Textstring.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Textstring.config new file mode 100644 index 0000000..cdd01a8 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Textstring.config @@ -0,0 +1,9 @@ + + + + Textstring + Umbraco.TextBox + Umb.PropertyEditorUi.TextBox + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Truefalse.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Truefalse.config new file mode 100644 index 0000000..8e59960 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/Truefalse.config @@ -0,0 +1,9 @@ + + + + True/false + Umbraco.TrueFalse + Umb.PropertyEditorUi.Toggle + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadArticle.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadArticle.config new file mode 100644 index 0000000..8d1b8b1 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadArticle.config @@ -0,0 +1,15 @@ + + + + Upload Article + Umbraco.UploadField + Umb.PropertyEditorUi.UploadField + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadAudio.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadAudio.config new file mode 100644 index 0000000..d798f12 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadAudio.config @@ -0,0 +1,16 @@ + + + + Upload Audio + Umbraco.UploadField + Umb.PropertyEditorUi.UploadField + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadFile.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadFile.config new file mode 100644 index 0000000..3a93565 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadFile.config @@ -0,0 +1,9 @@ + + + + Upload File + Umbraco.UploadField + Umb.PropertyEditorUi.UploadField + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadVectorGraphics.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadVectorGraphics.config new file mode 100644 index 0000000..c40992d --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadVectorGraphics.config @@ -0,0 +1,13 @@ + + + + Upload Vector Graphics + Umbraco.UploadField + Umb.PropertyEditorUi.UploadField + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadVideo.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadVideo.config new file mode 100644 index 0000000..43b0335 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/DataTypes/UploadVideo.config @@ -0,0 +1,15 @@ + + + + Upload Video + Umbraco.UploadField + Umb.PropertyEditorUi.UploadField + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Dictionary/home.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Dictionary/home.config new file mode 100644 index 0000000..66b4874 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Dictionary/home.config @@ -0,0 +1,9 @@ + + + + + Hjem + Home + Home ES + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Dictionary/test.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Dictionary/test.config new file mode 100644 index 0000000..acbdfcc --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Dictionary/test.config @@ -0,0 +1,8 @@ + + + + + Test in DK - fellback to this as no EN value set + Test in ES + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/da_da.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/da_da.config new file mode 100644 index 0000000..5416a32 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/da_da.config @@ -0,0 +1,8 @@ + + + + false + da + /Home + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/en_en-us.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/en_en-us.config new file mode 100644 index 0000000..511ac25 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/en_en-us.config @@ -0,0 +1,8 @@ + + + + false + en-US + /Home + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/es_es.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/es_es.config new file mode 100644 index 0000000..4768190 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Domains/es_es.config @@ -0,0 +1,8 @@ + + + + false + es + /Home + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/da.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/da.config new file mode 100644 index 0000000..e34562c --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/da.config @@ -0,0 +1,7 @@ + + + Danish + da + false + false + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/en-us.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/en-us.config new file mode 100644 index 0000000..c212dd9 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/en-us.config @@ -0,0 +1,7 @@ + + + English (United States) + en-US + false + true + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/es.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/es.config new file mode 100644 index 0000000..1364672 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Languages/es.config @@ -0,0 +1,7 @@ + + + Spanish + es + false + false + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Media/ashim-d-silva-weyamle9fdm-unsplash.jpg.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Media/ashim-d-silva-weyamle9fdm-unsplash.jpg.config new file mode 100644 index 0000000..fd16429 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Media/ashim-d-silva-weyamle9fdm-unsplash.jpg.config @@ -0,0 +1,47 @@ + + + + + /ashimDSilvaWeYamle9fDMUnsplashjpg + false + Image + 2025-10-13T22:03:44 + + 1 + + + + + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Media/face-savoring-food.svg.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Media/face-savoring-food.svg.config new file mode 100644 index 0000000..a7cc126 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Media/face-savoring-food.svg.config @@ -0,0 +1,17 @@ + + + + + /faceSavoringFoodsvg + false + umbracoMediaVectorGraphics + 2025-08-28T17:04:41 + + 0 + + + + + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/file.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/file.config new file mode 100644 index 0000000..5570434 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/file.config @@ -0,0 +1,71 @@ + + + + File + icon-document + icon-document + + True + 00000000-0000-0000-0000-000000000000 + Nothing + false + + + + + f9527050-59bc-43e4-8fa8-1658d1319ff5 + Size + umbracoBytes + 930861bf-e262-4ead-a704-f99453565708 + Umbraco.Label + false + + + 2 + File + + + false + + + 3531c0a3-4e0a-4324-a621-b9d3822b071f + Type + umbracoExtension + f0bc4bfb-b499-40d6-ba86-058885a5178c + Umbraco.Label + false + + + 1 + File + + + false + + + a0fb68f3-f427-47a6-afce-536ffa5b64e9 + File + umbracoFile + 84c6b441-31df-4ffe-b67e-67d5bc3ae65a + Umbraco.UploadField + true + + + 0 + File + + + false + + + + + + 50899f9c-023a-4466-b623-aba9049885fe + File + file + Group + 1 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/folder.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/folder.config new file mode 100644 index 0000000..fc1efad --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/folder.config @@ -0,0 +1,25 @@ + + + + Folder + icon-folder + icon-folder + + True + 3a0156c4-3b8c-4803-bdc1-6871faa83fff + Nothing + false + + + + + Folder + Image + File + umbracoMediaVideo + umbracoMediaAudio + umbracoMediaArticle + umbracoMediaVectorGraphics + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/image.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/image.config new file mode 100644 index 0000000..6377c45 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/image.config @@ -0,0 +1,101 @@ + + + + Image + icon-picture + icon-picture + + True + 00000000-0000-0000-0000-000000000000 + Nothing + false + + + + + bd4c5ace-26e3-4a8b-af1a-e8206a35fa07 + Size + umbracoBytes + 930861bf-e262-4ead-a704-f99453565708 + Umbraco.Label + false + + + 3 + Image + + + false + + + f7786fe8-724a-4ed0-b244-72546db32a92 + Type + umbracoExtension + f0bc4bfb-b499-40d6-ba86-058885a5178c + Umbraco.Label + false + + + 4 + Image + + + false + + + b646ca8f-e469-4fc2-a48a-d4dc1aa64a53 + Image + umbracoFile + 1df9f033-e6d4-451f-b8d2-e0cbc50a836f + Umbraco.ImageCropper + true + + + 0 + Image + + + false + + + 854087f6-648b-40ed-bc98-b8a9789e80b9 + Height + umbracoHeight + 8e7f995c-bd81-4627-9932-c40e568ec788 + Umbraco.Label + false + + + 2 + Image + + + false + + + a68d453b-1f62-44f4-9f71-0b6bbd43c355 + Width + umbracoWidth + 8e7f995c-bd81-4627-9932-c40e568ec788 + Umbraco.Label + false + + + 1 + Image + + + false + + + + + + 79ed4d07-254a-42cf-8fa9-ebe1c116a596 + Image + image + Group + 1 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediaarticle.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediaarticle.config new file mode 100644 index 0000000..5d2afb3 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediaarticle.config @@ -0,0 +1,71 @@ + + + + Article + icon-article + icon-article + + True + 00000000-0000-0000-0000-000000000000 + Nothing + false + + + + + aab7d00c-7209-4337-be3f-a4421c8d79a0 + Size + umbracoBytes + 930861bf-e262-4ead-a704-f99453565708 + Umbraco.Label + false + + + 2 + Article + + + false + + + ef1b4af7-36de-45eb-8c18-a2de07319227 + Type + umbracoExtension + f0bc4bfb-b499-40d6-ba86-058885a5178c + Umbraco.Label + false + + + 1 + Article + + + false + + + e5c8c2d0-2d82-4f01-b53a-45a1d1cbf19c + Article + umbracoFile + bc1e266c-dac4-4164-bf08-8a1ec6a7143d + Umbraco.UploadField + true + + + 0 + Article + + + false + + + + + + 9af3bd65-f687-4453-9518-5f180d1898ec + Article + article + Group + 1 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediaaudio.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediaaudio.config new file mode 100644 index 0000000..5d03eb1 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediaaudio.config @@ -0,0 +1,71 @@ + + + + Audio + icon-audio-lines + icon-audio-lines + + True + 00000000-0000-0000-0000-000000000000 + Nothing + false + + + + + 3cbf538a-29ab-4317-a9eb-bbcdf1a54260 + Size + umbracoBytes + 930861bf-e262-4ead-a704-f99453565708 + Umbraco.Label + false + + + 2 + Audio + + + false + + + 1bee433f-a21a-4031-8e03-af01bb8d2de9 + Type + umbracoExtension + f0bc4bfb-b499-40d6-ba86-058885a5178c + Umbraco.Label + false + + + 1 + Audio + + + false + + + 1f48d730-f174-4684-afad-a335e59d84a0 + Audio + umbracoFile + 8f430dd6-4e96-447e-9dc0-cb552c8cd1f3 + Umbraco.UploadField + true + + + 0 + Audio + + + false + + + + + + 335fb495-0a87-4e82-b902-30eb367b767c + Audio + audio + Group + 1 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediavectorgraphics.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediavectorgraphics.config new file mode 100644 index 0000000..1a9ac55 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediavectorgraphics.config @@ -0,0 +1,71 @@ + + + + Vector Graphics (SVG) + icon-origami + icon-origami + + True + 00000000-0000-0000-0000-000000000000 + Nothing + false + + + + + 09a07aff-861d-4769-a2b0-c165ebd43d39 + Size + umbracoBytes + 930861bf-e262-4ead-a704-f99453565708 + Umbraco.Label + false + + + 2 + Vector Graphics + + + false + + + 0f25a89e-2eb7-49bc-a7b4-759a7e4c69f2 + Type + umbracoExtension + f0bc4bfb-b499-40d6-ba86-058885a5178c + Umbraco.Label + false + + + 1 + Vector Graphics + + + false + + + e2a2bdf2-971b-483e-95a1-4104cc06af26 + Vector Graphics + umbracoFile + 215cb418-2153-4429-9aef-8c0f0041191b + Umbraco.UploadField + true + + + 0 + Vector Graphics + + + false + + + + + + f199b4d7-9e84-439f-8531-f87d9af37711 + Vector Graphics + vectorGraphics + Group + 1 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediavideo.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediavideo.config new file mode 100644 index 0000000..84e05ca --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MediaTypes/umbracomediavideo.config @@ -0,0 +1,71 @@ + + + + Video + icon-video + icon-video + + True + 00000000-0000-0000-0000-000000000000 + Nothing + false + + + + + 180eeecf-1f00-409e-8234-bba967e08b0a + Size + umbracoBytes + 930861bf-e262-4ead-a704-f99453565708 + Umbraco.Label + false + + + 2 + Video + + + false + + + edd2b3fd-1e57-4e57-935e-096defccdc9b + Type + umbracoExtension + f0bc4bfb-b499-40d6-ba86-058885a5178c + Umbraco.Label + false + + + 1 + Video + + + false + + + bed8ab97-d85f-44d2-a8b9-aef6893f9610 + Video + umbracoFile + 70575fe7-9812-4396-bbe1-c81a76db71b5 + Umbraco.UploadField + true + + + 0 + Video + + + false + + + + + + 2f0a61b6-cf92-4ff4-b437-751ab35eb254 + Video + video + Group + 1 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MemberTypes/member.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MemberTypes/member.config new file mode 100644 index 0000000..91898b5 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/MemberTypes/member.config @@ -0,0 +1,44 @@ + + + + Member + icon-user + icon-user + + False + 00000000-0000-0000-0000-000000000000 + Nothing + false + + + + + 2a280588-0000-0000-0000-000000000000 + Comments + umbracoMemberComments + c6bac0dd-4ab9-45b1-8e30-e4b619ee5da3 + Umbraco.TextArea + false + + + 0 + Membership + false + false + false + + + false + + + + + + 0756729d-d665-46e3-b84a-37aceaa614f8 + Membership + membership + Group + 1 + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/RelationTypes/umbMember.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/RelationTypes/umbMember.config new file mode 100644 index 0000000..fc28636 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/RelationTypes/umbMember.config @@ -0,0 +1,10 @@ + + + + Related Member + + + false + true + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/home.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/home.config new file mode 100644 index 0000000..92af027 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/home.config @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/layout.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/layout.config new file mode 100644 index 0000000..8d00e69 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/layout.config @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/page.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/page.config new file mode 100644 index 0000000..2d5dd24 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/Templates/page.config @@ -0,0 +1,5 @@ + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/uSync/v16/usync.config b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/usync.config new file mode 100644 index 0000000..750aad6 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/uSync/v16/usync.config @@ -0,0 +1,2 @@ + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/File.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/File.generated.cs new file mode 100644 index 0000000..3280b11 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/File.generated.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// File + [PublishedModel("File")] + public partial class File : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "File"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Media; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public File(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Size: in bytes + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoBytes")] + public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); + + /// + /// Type + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoExtension")] + public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); + + /// + /// File + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoFile")] + public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Folder.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Folder.generated.cs new file mode 100644 index 0000000..26037a4 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Folder.generated.cs @@ -0,0 +1,52 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Folder + [PublishedModel("Folder")] + public partial class Folder : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "Folder"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Media; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public Folder(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Home.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Home.generated.cs new file mode 100644 index 0000000..d47add5 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Home.generated.cs @@ -0,0 +1,92 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Home + [PublishedModel("home")] + public partial class Home : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "home"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Content; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public Home(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// CTA Link: A link to some important call to action + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("ctaLink")] + public virtual global::Umbraco.Cms.Core.Models.Link CtaLink => this.Value(_publishedValueFallback, "ctaLink"); + + /// + /// Empty Link: Used to test our-link with fallback + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("emptyLink")] + public virtual global::Umbraco.Cms.Core.Models.Link EmptyLink => this.Value(_publishedValueFallback, "emptyLink"); + + /// + /// Header + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("header")] + public virtual string Header => this.Value(_publishedValueFallback, "header"); + + /// + /// Image + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("image")] + public virtual global::Umbraco.Cms.Core.Models.MediaWithCrops Image => this.Value(_publishedValueFallback, "image"); + + /// + /// Logo + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("logo")] + public virtual global::Umbraco.Cms.Core.Models.MediaWithCrops Logo => this.Value(_publishedValueFallback, "logo"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Image.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Image.generated.cs new file mode 100644 index 0000000..28d308a --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Image.generated.cs @@ -0,0 +1,89 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Image + [PublishedModel("Image")] + public partial class Image : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "Image"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Media; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public Image(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Size: in bytes + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoBytes")] + public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); + + /// + /// Type + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoExtension")] + public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); + + /// + /// Image + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoFile")] + public virtual global::Umbraco.Cms.Core.PropertyEditors.ValueConverters.ImageCropperValue UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); + + /// + /// Height: in pixels + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoHeight")] + public virtual int UmbracoHeight => this.Value(_publishedValueFallback, "umbracoHeight"); + + /// + /// Width: in pixels + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoWidth")] + public virtual int UmbracoWidth => this.Value(_publishedValueFallback, "umbracoWidth"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Member.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Member.generated.cs new file mode 100644 index 0000000..d956a92 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Member.generated.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Member + [PublishedModel("Member")] + public partial class Member : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "Member"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Member; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public Member(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Comments + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoMemberComments")] + public virtual string UmbracoMemberComments => this.Value(_publishedValueFallback, "umbracoMemberComments"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Page.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Page.generated.cs new file mode 100644 index 0000000..63b55ba --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/Page.generated.cs @@ -0,0 +1,60 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Page + [PublishedModel("page")] + public partial class Page : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "page"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Content; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public Page(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Header + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("header")] + public virtual string Header => this.Value(_publishedValueFallback, "header"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaArticle.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaArticle.generated.cs new file mode 100644 index 0000000..db037a0 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaArticle.generated.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Article + [PublishedModel("umbracoMediaArticle")] + public partial class UmbracoMediaArticle : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "umbracoMediaArticle"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Media; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public UmbracoMediaArticle(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Size: in bytes + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoBytes")] + public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); + + /// + /// Type + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoExtension")] + public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); + + /// + /// Article + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoFile")] + public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaAudio.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaAudio.generated.cs new file mode 100644 index 0000000..39ad82b --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaAudio.generated.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Audio + [PublishedModel("umbracoMediaAudio")] + public partial class UmbracoMediaAudio : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "umbracoMediaAudio"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Media; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public UmbracoMediaAudio(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Size: in bytes + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoBytes")] + public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); + + /// + /// Type + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoExtension")] + public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); + + /// + /// Audio + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoFile")] + public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaVectorGraphics.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaVectorGraphics.generated.cs new file mode 100644 index 0000000..c1d7090 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaVectorGraphics.generated.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Vector Graphics (SVG) + [PublishedModel("umbracoMediaVectorGraphics")] + public partial class UmbracoMediaVectorGraphics : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "umbracoMediaVectorGraphics"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Media; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public UmbracoMediaVectorGraphics(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Size: in bytes + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoBytes")] + public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); + + /// + /// Type + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoExtension")] + public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); + + /// + /// Vector Graphics + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoFile")] + public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaVideo.generated.cs b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaVideo.generated.cs new file mode 100644 index 0000000..3de3614 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/umbraco/models/UmbracoMediaVideo.generated.cs @@ -0,0 +1,75 @@ +//------------------------------------------------------------------------------ +// +// This code was generated by a tool. +// +// Umbraco.ModelsBuilder.Embedded +// +// Changes to this file will be lost if the code is regenerated. +// +//------------------------------------------------------------------------------ + +using System; +using System.Linq.Expressions; +using Umbraco.Cms.Core.Models.PublishedContent; +using Umbraco.Cms.Core.PublishedCache; +using Umbraco.Cms.Infrastructure.ModelsBuilder; +using Umbraco.Cms.Core; +using Umbraco.Extensions; + +namespace Umbraco.Cms.Web.Common.PublishedModels +{ + /// Video + [PublishedModel("umbracoMediaVideo")] + public partial class UmbracoMediaVideo : PublishedContentModel + { + // helpers +#pragma warning disable 0109 // new is redundant + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const string ModelTypeAlias = "umbracoMediaVideo"; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + public new const PublishedItemType ModelItemType = PublishedItemType.Media; + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public new static IPublishedContentType GetModelContentType(IPublishedContentTypeCache contentTypeCache) + => PublishedModelUtility.GetModelContentType(contentTypeCache, ModelItemType, ModelTypeAlias); + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [return: global::System.Diagnostics.CodeAnalysis.MaybeNull] + public static IPublishedPropertyType GetModelPropertyType(IPublishedContentTypeCache contentTypeCache, Expression> selector) + => PublishedModelUtility.GetModelPropertyType(GetModelContentType(contentTypeCache), selector); +#pragma warning restore 0109 + + private IPublishedValueFallback _publishedValueFallback; + + // ctor + public UmbracoMediaVideo(IPublishedContent content, IPublishedValueFallback publishedValueFallback) + : base(content, publishedValueFallback) + { + _publishedValueFallback = publishedValueFallback; + } + + // properties + + /// + /// Size: in bytes + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [ImplementPropertyType("umbracoBytes")] + public virtual long UmbracoBytes => this.Value(_publishedValueFallback, "umbracoBytes"); + + /// + /// Type + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoExtension")] + public virtual string UmbracoExtension => this.Value(_publishedValueFallback, "umbracoExtension"); + + /// + /// Video + /// + [global::System.CodeDom.Compiler.GeneratedCodeAttribute("Umbraco.ModelsBuilder.Embedded", "")] + [global::System.Diagnostics.CodeAnalysis.MaybeNull] + [ImplementPropertyType("umbracoFile")] + public virtual string UmbracoFile => this.Value(_publishedValueFallback, "umbracoFile"); + } +} diff --git a/Our.Umbraco.TagHelpers.TestSite/wwwroot/css/Styles.css b/Our.Umbraco.TagHelpers.TestSite/wwwroot/css/Styles.css new file mode 100644 index 0000000..aff435e --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/wwwroot/css/Styles.css @@ -0,0 +1,13 @@ +* { + font-family: "Geist", sans-serif; +} + +.selected { + font-weight: 800; + color:green; +} + +.nav-link--active { + font-weight: 800; + color: red; +} \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/wwwroot/favicon.ico b/Our.Umbraco.TagHelpers.TestSite/wwwroot/favicon.ico new file mode 100644 index 0000000..63e859b Binary files /dev/null and b/Our.Umbraco.TagHelpers.TestSite/wwwroot/favicon.ico differ diff --git a/Our.Umbraco.TagHelpers.TestSite/wwwroot/media/wqmnqu3q/ashim-d-silva-weyamle9fdm-unsplash.jpg b/Our.Umbraco.TagHelpers.TestSite/wwwroot/media/wqmnqu3q/ashim-d-silva-weyamle9fdm-unsplash.jpg new file mode 100644 index 0000000..5bec0fc Binary files /dev/null and b/Our.Umbraco.TagHelpers.TestSite/wwwroot/media/wqmnqu3q/ashim-d-silva-weyamle9fdm-unsplash.jpg differ diff --git a/Our.Umbraco.TagHelpers.TestSite/wwwroot/samples/face-savoring-food.svg b/Our.Umbraco.TagHelpers.TestSite/wwwroot/samples/face-savoring-food.svg new file mode 100644 index 0000000..0cf5e6c --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/wwwroot/samples/face-savoring-food.svg @@ -0,0 +1,130 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.TestSite/wwwroot/samples/partying-face.svg b/Our.Umbraco.TagHelpers.TestSite/wwwroot/samples/partying-face.svg new file mode 100644 index 0000000..e3c6983 --- /dev/null +++ b/Our.Umbraco.TagHelpers.TestSite/wwwroot/samples/partying-face.svg @@ -0,0 +1,181 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.Tests/IncludeIfTagHelperTests.cs b/Our.Umbraco.TagHelpers.Tests/IncludeIfTagHelperTests.cs index 727bdbb..122b674 100644 --- a/Our.Umbraco.TagHelpers.Tests/IncludeIfTagHelperTests.cs +++ b/Our.Umbraco.TagHelpers.Tests/IncludeIfTagHelperTests.cs @@ -1,6 +1,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers; using NUnit.Framework; using System.Threading.Tasks; +using NUnit.Framework.Legacy; using Our.Umbraco.TagHelpers.Tests.Helpers; namespace Our.Umbraco.TagHelpers.Tests @@ -27,7 +28,7 @@ public async Task Given_Predicate_Return_Contents_Or_Empty(bool predicate, strin var content = tagHelperOutput.Content.GetContent(); // Assert - Assert.AreEqual(expected, content); + ClassicAssert.AreEqual(expected, content); } } } \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.Tests/InlineSvgTagHelperTests.cs b/Our.Umbraco.TagHelpers.Tests/InlineSvgTagHelperTests.cs index fc32d84..4aab01b 100644 --- a/Our.Umbraco.TagHelpers.Tests/InlineSvgTagHelperTests.cs +++ b/Our.Umbraco.TagHelpers.Tests/InlineSvgTagHelperTests.cs @@ -11,7 +11,7 @@ using System.IO; using System.Text; using System.Threading.Tasks; -using Umbraco.Cms.Core.Configuration.Models; +using NUnit.Framework.Legacy; using Umbraco.Cms.Core.IO; using Umbraco.Cms.Core.Models.PublishedContent; using Umbraco.Cms.Core.Routing; @@ -61,7 +61,7 @@ public void NoOutputIfNoMediaOrFileSet() tagHelper.Process(_context, _output); - Assert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); + ClassicAssert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); } [Test] @@ -76,7 +76,7 @@ public void NoOutputIfBothMediaAndFileSet() tagHelper.Process(_context, _output); - Assert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); + ClassicAssert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); } [Test] @@ -89,7 +89,7 @@ public void NoOutputIfFileNotSvg() tagHelper.Process(_context, _output); - Assert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); + ClassicAssert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); } [Test] @@ -105,7 +105,7 @@ public void NoOutputIfFileNotFound() tagHelper.Process(_context, _output); - Assert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); + ClassicAssert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); } [Test] @@ -121,10 +121,10 @@ public void ExpectedOutputIfValidFile() tagHelper.Process(_context, _output); - Assert.IsNull(_output?.TagName); - Assert.AreEqual(_output.Content.GetContent(), "test svg"); - Assert.IsFalse(_output.Attributes.ContainsName("src")); - Assert.IsFalse(_output.Attributes.ContainsName("media-item")); + ClassicAssert.IsNull(_output?.TagName); + ClassicAssert.AreEqual(_output.Content.GetContent(), "test svg"); + ClassicAssert.IsFalse(_output.Attributes.ContainsName("src")); + ClassicAssert.IsFalse(_output.Attributes.ContainsName("media-item")); } [Test] @@ -139,7 +139,7 @@ public void NoOutputIfMediaUrlNull() tagHelper.Process(_context, _output); - Assert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); + ClassicAssert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); } [Test] @@ -155,7 +155,7 @@ public void NoOutputIfMediaNotSvg() tagHelper.Process(_context, _output); - Assert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); + ClassicAssert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); } [Test] @@ -166,7 +166,7 @@ public void NoOutputIfMediaNotFound() urlProvider.Setup(p => p.GetMediaUrl(umbContent, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns("test.svg"); var fileSystem = Mock.Of(fs => !fs.FileExists(It.IsAny())); var tagHelper = new InlineSvgTagHelper( - new MediaFileManager(fileSystem, null, null, null, null, Mock.Of>()), + new MediaFileManager(fileSystem, null, null, null, null), null, urlProvider.Object, _settings, @@ -178,7 +178,7 @@ public void NoOutputIfMediaNotFound() tagHelper.Process(_context, _output); - Assert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); + ClassicAssert.IsTrue(_output.Content.IsEmptyOrWhiteSpace); } [Test] @@ -189,7 +189,7 @@ public void ExpectedOutputIfValidMedia() urlProvider.Setup(p => p.GetMediaUrl(umbContent, It.IsAny(), It.IsAny(), It.IsAny(), It.IsAny())).Returns("test.svg"); var fileSystem = Mock.Of(fs => fs.FileExists(It.IsAny()) && fs.OpenFile(It.IsAny()) == new MemoryStream(Encoding.UTF8.GetBytes("test svg"))); var tagHelper = new InlineSvgTagHelper( - new MediaFileManager(fileSystem, null, null, null, null, Mock.Of>()), + new MediaFileManager(fileSystem, null, null, null, null), null, urlProvider.Object, _settings, @@ -201,10 +201,10 @@ public void ExpectedOutputIfValidMedia() tagHelper.Process(_context, _output); - Assert.IsNull(_output?.TagName); - Assert.AreEqual("test svg", _output.Content.GetContent()); - Assert.IsFalse(_output.Attributes.ContainsName("src")); - Assert.IsFalse(_output.Attributes.ContainsName("media-item")); + ClassicAssert.IsNull(_output?.TagName); + ClassicAssert.AreEqual("test svg", _output.Content.GetContent()); + ClassicAssert.IsFalse(_output.Attributes.ContainsName("src")); + ClassicAssert.IsFalse(_output.Attributes.ContainsName("media-item")); } [Test] @@ -222,7 +222,7 @@ public void SanitizesJavascript() tagHelper.Process(_context, _output); - Assert.AreEqual("Click hereend", _output.Content.GetContent()); + ClassicAssert.AreEqual("Click hereend", _output.Content.GetContent()); } } } diff --git a/Our.Umbraco.TagHelpers.Tests/LinkTagHelperTests.cs b/Our.Umbraco.TagHelpers.Tests/LinkTagHelperTests.cs index 55ae682..bb9f817 100644 --- a/Our.Umbraco.TagHelpers.Tests/LinkTagHelperTests.cs +++ b/Our.Umbraco.TagHelpers.Tests/LinkTagHelperTests.cs @@ -3,6 +3,7 @@ using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.TagHelpers; using NUnit.Framework; +using NUnit.Framework.Legacy; using Our.Umbraco.TagHelpers.Tests.Helpers; using Umbraco.Cms.Core.Models; @@ -33,7 +34,7 @@ public async Task Internal_Link_Renders_AnchorAroundContentOrLinkName(string chi LinkTagHelper tagHelper = new() { Link = _onSiteLink }; var markup = await GetMarkupAsync(tagHelper, output); - Assert.AreEqual($"{expectedContent}", markup); + ClassicAssert.AreEqual($"{expectedContent}", markup); } [TestCase("", "example")] @@ -47,7 +48,7 @@ public async Task External_Link_Renders_AnchorAroundContentOrLinkName(string chi LinkTagHelper tagHelper = new() { Link = _externalLink }; var markup = await GetMarkupAsync(tagHelper, output); - Assert.AreEqual($"{expectedContent}", markup); + ClassicAssert.AreEqual($"{expectedContent}", markup); } [Test] @@ -59,7 +60,7 @@ public async Task NoUrl_WithoutFallback_RendersNothing() LinkTagHelper tagHelper = new() { Link = new() }; var markup = await GetMarkupAsync(tagHelper, output); - Assert.AreEqual(string.Empty, markup); + ClassicAssert.AreEqual(string.Empty, markup); } [Test] @@ -71,7 +72,7 @@ public async Task Null_Link_WithoutFallback_RendersNothing() LinkTagHelper tagHelper = new() { Link = null }; var markup = await GetMarkupAsync(tagHelper, output); - Assert.AreEqual(string.Empty, markup); + ClassicAssert.AreEqual(string.Empty, markup); } [TestCase("", "")] @@ -85,7 +86,7 @@ public async Task Null_Link_WithFallback_NoElement_RendersContent(string childCo LinkTagHelper tagHelper = new() { Link = null, Fallback = true }; var markup = await GetMarkupAsync(tagHelper, output); - Assert.AreEqual(expectedContent, markup); + ClassicAssert.AreEqual(expectedContent, markup); } [TestCase("", "")] @@ -99,7 +100,7 @@ public async Task Null_Link_WithFallback_AndElement_RendersContent(string childC LinkTagHelper tagHelper = new() { Link = null, Fallback = true, FallbackElement = "div" }; var markup = await GetMarkupAsync(tagHelper, output); - Assert.AreEqual(expectedContent, markup); + ClassicAssert.AreEqual(expectedContent, markup); } private async Task GetMarkupAsync(LinkTagHelper tagHelper, TagHelperOutput output) diff --git a/Our.Umbraco.TagHelpers.Tests/Our.Umbraco.TagHelpers.Tests.csproj b/Our.Umbraco.TagHelpers.Tests/Our.Umbraco.TagHelpers.Tests.csproj index 341eb07..5d353cc 100644 --- a/Our.Umbraco.TagHelpers.Tests/Our.Umbraco.TagHelpers.Tests.csproj +++ b/Our.Umbraco.TagHelpers.Tests/Our.Umbraco.TagHelpers.Tests.csproj @@ -1,19 +1,19 @@  - net5.0 + net9.0 false - - - - - - - + + + + + + + all runtime; build; native; contentfiles; analyzers; buildtransitive diff --git a/Our.Umbraco.TagHelpers.Tests/SelfHostServiceTests.cs b/Our.Umbraco.TagHelpers.Tests/SelfHostServiceTests.cs index 78d6308..4917334 100644 --- a/Our.Umbraco.TagHelpers.Tests/SelfHostServiceTests.cs +++ b/Our.Umbraco.TagHelpers.Tests/SelfHostServiceTests.cs @@ -5,6 +5,7 @@ using Our.Umbraco.TagHelpers.Configuration; using Our.Umbraco.TagHelpers.Services; using System; +using NUnit.Framework.Legacy; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Logging; @@ -51,7 +52,7 @@ public void GetRemoteFolderPath_GivenUriWithMoreThanTwoSegments_ReturnsFolderPat var result = _service.GetRemoteFolderPath(uri); // Assert - Assert.AreEqual(expectedFolderPath, result); + ClassicAssert.AreEqual(expectedFolderPath, result); } [Test] @@ -65,7 +66,7 @@ public void GetRemoteFolderPath_GivenUriWithLessThanTwoSegments_ReturnsEmptyStri var result = _service.GetRemoteFolderPath(uri); // Assert - Assert.AreEqual(expectedFolderPath, result); + ClassicAssert.AreEqual(expectedFolderPath, result); } } } \ No newline at end of file diff --git a/Our.Umbraco.TagHelpers.Tests/SelfHostTagHelperTests.cs b/Our.Umbraco.TagHelpers.Tests/SelfHostTagHelperTests.cs index 060a10c..66da4f7 100644 --- a/Our.Umbraco.TagHelpers.Tests/SelfHostTagHelperTests.cs +++ b/Our.Umbraco.TagHelpers.Tests/SelfHostTagHelperTests.cs @@ -5,6 +5,7 @@ using Our.Umbraco.TagHelpers.Services; using Our.Umbraco.TagHelpers.Tests.Helpers; using System.Threading.Tasks; +using NUnit.Framework.Legacy; namespace Our.Umbraco.TagHelpers.Tests { @@ -29,7 +30,7 @@ public async Task ProcessAsync_SrcAttribute_SetsSrcAttribute() await tagHelper.ProcessAsync(tagHelperContext, output); // Assert - Assert.AreEqual("/media/test.jpg", output.Attributes["src"].Value); + ClassicAssert.AreEqual("/media/test.jpg", output.Attributes["src"].Value); } [Test] @@ -50,7 +51,7 @@ public async Task ProcessAsync_HrefAttribute_SetsHrefAttribute() await tagHelper.ProcessAsync(tagHelperContext, output); // Assert - Assert.AreEqual("/media/test.pdf", output.Attributes["href"].Value); + ClassicAssert.AreEqual("/media/test.pdf", output.Attributes["href"].Value); } [Test] @@ -71,7 +72,7 @@ public async Task ProcessAsync_RemovesOurSelfHostAttribute() await tagHelper.ProcessAsync(tagHelperContext, output); // Assert - Assert.IsFalse(output.Attributes.ContainsName("our-self-host")); + ClassicAssert.IsFalse(output.Attributes.ContainsName("our-self-host")); } [Test] @@ -93,7 +94,7 @@ public async Task ProcessAsync_RemovesFolderAttribute() await tagHelper.ProcessAsync(tagHelperContext, output); // Assert - Assert.IsFalse(output.Attributes.ContainsName("folder")); + ClassicAssert.IsFalse(output.Attributes.ContainsName("folder")); } [Test] @@ -115,7 +116,7 @@ public async Task ProcessAsync_RemovesExtAttribute() await tagHelper.ProcessAsync(tagHelperContext, output); // Assert - Assert.IsFalse(output.Attributes.ContainsName("ext")); + ClassicAssert.IsFalse(output.Attributes.ContainsName("ext")); } [Test] @@ -137,7 +138,7 @@ public async Task ProcessAsync_SrcAttribute_EnforcesExtAttribute() await tagHelper.ProcessAsync(tagHelperContext, output); // Assert - Assert.IsTrue(output.Attributes.ContainsName("src") && output.Attributes["src"].Value.ToString().EndsWith(tagHelper.Extension)); + ClassicAssert.IsTrue(output.Attributes.ContainsName("src") && output.Attributes["src"].Value.ToString().EndsWith(tagHelper.Extension)); } [Test] @@ -159,7 +160,7 @@ public async Task ProcessAsync_HrefAttribute_EnforcesExtAttribute() await tagHelper.ProcessAsync(tagHelperContext, output); // Assert - Assert.IsTrue(output.Attributes.ContainsName("href") && output.Attributes["href"].Value.ToString().EndsWith(tagHelper.Extension)); + ClassicAssert.IsTrue(output.Attributes.ContainsName("href") && output.Attributes["href"].Value.ToString().EndsWith(tagHelper.Extension)); } } } diff --git a/Our.Umbraco.TagHelpers.sln b/Our.Umbraco.TagHelpers.sln index 292e1ad..3038a5a 100644 --- a/Our.Umbraco.TagHelpers.sln +++ b/Our.Umbraco.TagHelpers.sln @@ -7,7 +7,14 @@ Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Our.Umbraco.TagHelpers", "O EndProject Project("{9A19103F-16F7-4668-BE54-9A1E7A4F7556}") = "Our.Umbraco.TagHelpers.Tests", "Our.Umbraco.TagHelpers.Tests\Our.Umbraco.TagHelpers.Tests.csproj", "{7B3A523E-27A6-4D0D-B334-3B97183A06A9}" EndProject -Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.TagHelpers.ExampleSite", "Our.Umbraco.TagHelpers.ExampleSite\Our.Umbraco.TagHelpers.ExampleSite.csproj", "{89373ABC-0A48-4D6B-89B9-DB598267C05B}" +Project("{FAE04EC0-301F-11D3-BF4B-00C04F79EFBC}") = "Our.Umbraco.TagHelpers.TestSite", "Our.Umbraco.TagHelpers.TestSite\Our.Umbraco.TagHelpers.TestSite.csproj", "{C1817A7B-FF75-4171-B3A2-7E09FF81C1B1}" +EndProject +Project("{2150E333-8FDC-42A3-9474-1A3956D46DE8}") = "Build", "Build", "{E02EFFF8-724F-4BDC-A7FF-3091C831367C}" + ProjectSection(SolutionItems) = preProject + .github\workflows\codeql-analysis.yml = .github\workflows\codeql-analysis.yml + .github\workflows\dotnet.yml = .github\workflows\dotnet.yml + .github\workflows\release-nuget.yml = .github\workflows\release-nuget.yml + EndProjectSection EndProject Global GlobalSection(SolutionConfigurationPlatforms) = preSolution @@ -23,10 +30,10 @@ Global {7B3A523E-27A6-4D0D-B334-3B97183A06A9}.Debug|Any CPU.Build.0 = Debug|Any CPU {7B3A523E-27A6-4D0D-B334-3B97183A06A9}.Release|Any CPU.ActiveCfg = Release|Any CPU {7B3A523E-27A6-4D0D-B334-3B97183A06A9}.Release|Any CPU.Build.0 = Release|Any CPU - {89373ABC-0A48-4D6B-89B9-DB598267C05B}.Debug|Any CPU.ActiveCfg = Debug|Any CPU - {89373ABC-0A48-4D6B-89B9-DB598267C05B}.Debug|Any CPU.Build.0 = Debug|Any CPU - {89373ABC-0A48-4D6B-89B9-DB598267C05B}.Release|Any CPU.ActiveCfg = Release|Any CPU - {89373ABC-0A48-4D6B-89B9-DB598267C05B}.Release|Any CPU.Build.0 = Release|Any CPU + {C1817A7B-FF75-4171-B3A2-7E09FF81C1B1}.Debug|Any CPU.ActiveCfg = Debug|Any CPU + {C1817A7B-FF75-4171-B3A2-7E09FF81C1B1}.Debug|Any CPU.Build.0 = Debug|Any CPU + {C1817A7B-FF75-4171-B3A2-7E09FF81C1B1}.Release|Any CPU.ActiveCfg = Release|Any CPU + {C1817A7B-FF75-4171-B3A2-7E09FF81C1B1}.Release|Any CPU.Build.0 = Release|Any CPU EndGlobalSection GlobalSection(SolutionProperties) = preSolution HideSolutionNode = FALSE diff --git a/Our.Umbraco.TagHelpers/ActiveClassTagHelper.cs b/Our.Umbraco.TagHelpers/ActiveClassTagHelper.cs index 375a481..7f5f38e 100644 --- a/Our.Umbraco.TagHelpers/ActiveClassTagHelper.cs +++ b/Our.Umbraco.TagHelpers/ActiveClassTagHelper.cs @@ -4,6 +4,9 @@ using Umbraco.Extensions; using Microsoft.AspNetCore.Mvc.TagHelpers; using System; +using System.Threading.Tasks; +using Umbraco.Cms.Core.Routing; +using Umbraco.Cms.Core.Services; namespace Our.Umbraco.TagHelpers { @@ -24,10 +27,12 @@ public class ActiveClassTagHelper : TagHelper private const string tagHelperAttributes = tagHelperAttributeName + ", " + tagHelperAttributeHrefName; private IUmbracoContextAccessor _umbracoContextAccessor; + private readonly IDocumentUrlService _documentUrlService; - public ActiveClassTagHelper(IUmbracoContextAccessor umbracoContextAccessor) + public ActiveClassTagHelper(IUmbracoContextAccessor umbracoContextAccessor, IDocumentUrlService documentUrlService) { _umbracoContextAccessor = umbracoContextAccessor; + _documentUrlService = documentUrlService; } /// @@ -45,7 +50,7 @@ public ActiveClassTagHelper(IUmbracoContextAccessor umbracoContextAccessor) [HtmlAttributeName("our-active-href")] public string? ActiveLink { get; set; } - public override void Process(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { // Remove the attribute // We don't want it in the markup we send down to the page @@ -65,7 +70,10 @@ public override void Process(TagHelperContext context, TagHelperOutput output) if (Uri.TryCreate(href, UriKind.Absolute, out Uri? link) || Uri.TryCreate(ctx.PublishedRequest.Uri, href, out link)) { // Get the node based of the value in the HREF - var nodeOfLink = ctx.Content.GetByRoute(link.AbsolutePath); + // GetByRoute on IPublishedContentCache is obsolete now - need to use DocumentUrlService instead + var documentKeyFromUrl = _documentUrlService.GetDocumentKeyByRoute(link.AbsolutePath, null, null, false); + var nodeOfLink = documentKeyFromUrl is not null ? ctx.Content.GetById(documentKeyFromUrl.Value) : null; + if (nodeOfLink == null) { return; diff --git a/Our.Umbraco.TagHelpers/Composing/BackofficeUserComposer.cs b/Our.Umbraco.TagHelpers/Composing/BackofficeUserComposer.cs index 2b59df4..4e8e86b 100644 --- a/Our.Umbraco.TagHelpers/Composing/BackofficeUserComposer.cs +++ b/Our.Umbraco.TagHelpers/Composing/BackofficeUserComposer.cs @@ -5,7 +5,7 @@ namespace Our.Umbraco.TagHelpers.Composing { - public class CustomComposer : IComposer + public class BackofficeUserComposer : IComposer { public void Compose(IUmbracoBuilder builder) { diff --git a/Our.Umbraco.TagHelpers/Composing/InlineSvgTagHelperComposer.cs b/Our.Umbraco.TagHelpers/Composing/InlineSvgTagHelperComposer.cs index 63ec324..eed4c92 100644 --- a/Our.Umbraco.TagHelpers/Composing/InlineSvgTagHelperComposer.cs +++ b/Our.Umbraco.TagHelpers/Composing/InlineSvgTagHelperComposer.cs @@ -1,9 +1,4 @@ using Our.Umbraco.TagHelpers.Notifications; -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Notifications; diff --git a/Our.Umbraco.TagHelpers/Composing/PackageManifestComposer.cs b/Our.Umbraco.TagHelpers/Composing/PackageManifestComposer.cs index fd0f85d..6a0116c 100644 --- a/Our.Umbraco.TagHelpers/Composing/PackageManifestComposer.cs +++ b/Our.Umbraco.TagHelpers/Composing/PackageManifestComposer.cs @@ -1,7 +1,11 @@ using System.Collections.Generic; +using System.Threading.Tasks; +using Microsoft.Extensions.DependencyInjection; using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.DependencyInjection; using Umbraco.Cms.Core.Manifest; +using Umbraco.Cms.Infrastructure.Manifest; +using Umbraco.Extensions; namespace Our.Umbraco.TagHelpers.Composing { @@ -9,22 +13,28 @@ public class PackageManifestComposer : IComposer { public void Compose(IUmbracoBuilder builder) { - builder.ManifestFilters().Append(); + builder.Services.AddSingleton(); } } - public class TagHelperManifestFilter : IManifestFilter + public class TagHelperManifestReader : IPackageManifestReader { - public void Filter(List manifests) + public Task> ReadPackageManifestsAsync() { - var version = typeof(TagHelperManifestFilter).Assembly.GetName()?.Version?.ToString() ?? "Unknown"; - - manifests.Add(new PackageManifest + // Used to register a package manifest via C# + // As this package contains no backoffice extensions we are registering it via C# and not JS or JSON file + // User can then see this as intalled package in the backoffice and telemetry can be sent to Umbraco + var version = typeof(TagHelperManifestReader).Assembly.GetName()?.Version?.ToString() ?? "Unknown"; + var manifest = new PackageManifest { - PackageName = "Our Umbraco TagHelpers", - AllowPackageTelemetry = true, - Version = version - }); + Id = "Our.Umbraco.TagHelpers", + Name = "Our Umbraco TagHelpers", + AllowTelemetry = true, + Version = version, + Extensions = [] + }; + + return Task.FromResult(manifest.AsEnumerableOfOne()); } } } diff --git a/Our.Umbraco.TagHelpers/Configuration/OurUmbracoTagHelpersConfigurationComposer.cs b/Our.Umbraco.TagHelpers/Configuration/OurUmbracoTagHelpersConfigurationComposer.cs index bf3c1bf..e554ff6 100644 --- a/Our.Umbraco.TagHelpers/Configuration/OurUmbracoTagHelpersConfigurationComposer.cs +++ b/Our.Umbraco.TagHelpers/Configuration/OurUmbracoTagHelpersConfigurationComposer.cs @@ -1,5 +1,4 @@ using Microsoft.Extensions.DependencyInjection; -using Our.Umbraco.TagHelpers.Services; using Umbraco.Cms.Core.Composing; using Umbraco.Cms.Core.DependencyInjection; diff --git a/Our.Umbraco.TagHelpers/DictionaryTagHelper.cs b/Our.Umbraco.TagHelpers/DictionaryTagHelper.cs index 86c48f6..5942922 100644 --- a/Our.Umbraco.TagHelpers/DictionaryTagHelper.cs +++ b/Our.Umbraco.TagHelpers/DictionaryTagHelper.cs @@ -1,5 +1,7 @@ -using System.Globalization; +using System; +using System.Globalization; using System.Linq; +using System.Threading.Tasks; using Microsoft.AspNetCore.Razor.TagHelpers; using Umbraco.Cms.Core.Services; @@ -12,11 +14,11 @@ namespace Our.Umbraco.TagHelpers [HtmlTargetElement("our-dictionary", TagStructure = TagStructure.NormalOrSelfClosing)] public class DictionaryTagHelper : TagHelper { - private readonly ILocalizationService _localizationService; + private readonly IDictionaryItemService _dictionaryItemService; - public DictionaryTagHelper(ILocalizationService localizationService) + public DictionaryTagHelper(IDictionaryItemService dictionaryItemService) { - _localizationService = localizationService; + _dictionaryItemService = dictionaryItemService; } /// @@ -32,9 +34,9 @@ public DictionaryTagHelper(ILocalizationService localizationService) [HtmlAttributeName("fallback-lang")] public string? FallbackLang { get; set; } - public override void Process(TagHelperContext context, TagHelperOutput output) + public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) { - base.Process(context, output); + await base.ProcessAsync(context, output); output.TagName = ""; // Remove the outer tag of @@ -45,11 +47,11 @@ public override void Process(TagHelperContext context, TagHelperOutput output) var currentCulture = CultureInfo.CurrentCulture; // Ensure the Dictionary item/key even exist - var translation = _localizationService.GetDictionaryItemByKey(Key); + var translation = await _dictionaryItemService.GetAsync(Key); if (translation != null) { // Try to see if we have a value set for the current culture/language - var langTranslation = translation.Translations.FirstOrDefault(x => x.Language.CultureInfo.Name.Equals(currentCulture.Name, comparisonType: System.StringComparison.InvariantCultureIgnoreCase)); + var langTranslation = translation.Translations.FirstOrDefault(x => x.LanguageIsoCode.Equals(currentCulture.Name, comparisonType: StringComparison.InvariantCultureIgnoreCase)); if (string.IsNullOrEmpty(langTranslation?.Value) == false) { // Only replace the HTML inside the tag if we have a value @@ -60,7 +62,7 @@ public override void Process(TagHelperContext context, TagHelperOutput output) else if (string.IsNullOrEmpty(FallbackLang) == false) { // Try & see if we have a value set for fallback lang - var fallbackLangTranslation = translation.Translations.FirstOrDefault(x => x.Language.CultureInfo.Name.Equals(FallbackLang, comparisonType: System.StringComparison.InvariantCultureIgnoreCase)); + var fallbackLangTranslation = translation.Translations.FirstOrDefault(x => x.LanguageIsoCode.Equals(FallbackLang, comparisonType: StringComparison.InvariantCultureIgnoreCase)); if (string.IsNullOrEmpty(fallbackLangTranslation?.Value) == false) { // Only replace the HTML inside the tag if we have a value for the fallback lang diff --git a/Our.Umbraco.TagHelpers/EditLinkTagHelper.cs b/Our.Umbraco.TagHelpers/EditLinkTagHelper.cs index 18d61bb..2e246e5 100644 --- a/Our.Umbraco.TagHelpers/EditLinkTagHelper.cs +++ b/Our.Umbraco.TagHelpers/EditLinkTagHelper.cs @@ -2,6 +2,7 @@ using Microsoft.AspNetCore.Razor.TagHelpers; using Our.Umbraco.TagHelpers.Extensions; using Our.Umbraco.TagHelpers.Services; +using System; using System.Text; using Umbraco.Cms.Core.Web; @@ -25,16 +26,11 @@ public EditLinkTagHelper(IBackofficeUserAccessor backofficeUserAccessor, IUmbrac } /// - /// The id of the current content item + /// A string of the GUID/Key of the content item to link to + /// If not set it will use the current page's key /// - [HtmlAttributeName("content-id")] - public int ContentId { get; set; } = int.MinValue; - - /// - /// Override the umbraco edit content url if yours is different - /// - [HtmlAttributeName("edit-url")] - public string EditUrl { get; set; } = "/umbraco#/content/content/edit/"; + [HtmlAttributeName("content-key")] + public string ContentKey { get; set; } = string.Empty; /// /// A boolean to say whether or not you would like to use the default styling. @@ -54,14 +50,18 @@ public override void Process(TagHelperContext context, TagHelperOutput output) // and they have access to the content section if (_backofficeUserAccessor?.BackofficeUser != null && _backofficeUserAccessor.BackofficeUser.IsAllowedToSeeEditLink()) { - // Try & get Umbraco Current Node int ID (Only do this if ContentId has NOT been set) - if (_umbracoContextAccessor.TryGetUmbracoContext(out var umbracoContext) && ContentId == int.MinValue) + // Try & get Umbraco Current Node Key (Only do this if ContentKey has NOT been set) + if (_umbracoContextAccessor.TryGetUmbracoContext(out var umbracoContext) && string.IsNullOrWhiteSpace(ContentKey)) { - ContentId = umbracoContext.PublishedRequest.PublishedContent.Id; + if (umbracoContext.PublishedRequest?.PublishedContent is not null) + { + ContentKey = umbracoContext.PublishedRequest.PublishedContent.Key.ToString(); + } } // Backoffice URL to content item - var editLinkUrl = $"{EditUrl}{ContentId}"; + // /umbraco/section/content/workspace/document/edit/b0c59e4c-158c-4fd4-9beb-ebe907693f1c + var editLinkUrl = $"/umbraco/section/content/workspace/document/edit/{ContentKey}"; if (UseDefaultStyles) { diff --git a/Our.Umbraco.TagHelpers/Enums/ImagePlaceholderType.cs b/Our.Umbraco.TagHelpers/Enums/ImagePlaceholderType.cs index 7a98528..a1acc33 100644 --- a/Our.Umbraco.TagHelpers/Enums/ImagePlaceholderType.cs +++ b/Our.Umbraco.TagHelpers/Enums/ImagePlaceholderType.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Our.Umbraco.TagHelpers.Enums +namespace Our.Umbraco.TagHelpers.Enums { public enum ImagePlaceholderType { diff --git a/Our.Umbraco.TagHelpers/Enums/OurScreenSize.cs b/Our.Umbraco.TagHelpers/Enums/OurScreenSize.cs index 296ddcc..72f6de8 100644 --- a/Our.Umbraco.TagHelpers/Enums/OurScreenSize.cs +++ b/Our.Umbraco.TagHelpers/Enums/OurScreenSize.cs @@ -1,10 +1,4 @@ -using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; - -namespace Our.Umbraco.TagHelpers.Enums +namespace Our.Umbraco.TagHelpers.Enums { public enum OurScreenSize { diff --git a/Our.Umbraco.TagHelpers/Extensions/ClaimsIdentityExtensions.cs b/Our.Umbraco.TagHelpers/Extensions/ClaimsIdentityExtensions.cs index 2bd13d1..6dd1f48 100644 --- a/Our.Umbraco.TagHelpers/Extensions/ClaimsIdentityExtensions.cs +++ b/Our.Umbraco.TagHelpers/Extensions/ClaimsIdentityExtensions.cs @@ -1,6 +1,7 @@ using System.Linq; using System.Security.Claims; using Umbraco.Cms.Core; +using Umbraco.Extensions; namespace Our.Umbraco.TagHelpers.Extensions { @@ -20,7 +21,7 @@ public static bool IsLoggedIntoUmbraco(this ClaimsIdentity identity) public static bool HasAccessToContentSection(this ClaimsIdentity identity) { return identity?.Claims != null && identity.Claims.Any(x => - x.Type == Constants.Security.AllowedApplicationsClaimType + x.Type == Constants.Security.AllowedApplicationsClaimType //TODO: OBSOLETE THING TO LOOK INTO && x.Value == Constants.Conventions.PermissionCategories.ContentCategory); } } diff --git a/Our.Umbraco.TagHelpers/Extensions/WebHostEnvironmentExtensions.cs b/Our.Umbraco.TagHelpers/Extensions/WebHostEnvironmentExtensions.cs deleted file mode 100644 index 2c39ee7..0000000 --- a/Our.Umbraco.TagHelpers/Extensions/WebHostEnvironmentExtensions.cs +++ /dev/null @@ -1,48 +0,0 @@ -using Microsoft.AspNetCore.Hosting; -using System; -using System.IO; -using Umbraco.Cms.Core; - -namespace Our.Umbraco.TagHelpers.Extensions -{ - [Obsolete("This should be removed, when the package gets upgraded past Umbraco 10")] - public static class WebHostEnvironmentExtensions - { - - /// - /// Maps a virtual path to a physical path to the application's web root - /// - /// - /// Depending on the runtime 'web root', this result can vary. For example in Net Framework the web root and the - /// content root are the same, however - /// in netcore the web root is /wwwroot therefore this will Map to a physical path within wwwroot. - /// - - [Obsolete("This should be removed, when the package gets upgraded past Umbraco 10")] - public static string MapPathWebRoot(this IWebHostEnvironment webHostEnvironment, string path) - { - var root = webHostEnvironment.WebRootPath; - - // Create if missing - if (string.IsNullOrWhiteSpace(root)) - { - root = webHostEnvironment.WebRootPath = Path.Combine(Directory.GetCurrentDirectory(), "wwwroot"); - } - - var newPath = path.Replace('/', Path.DirectorySeparatorChar).Replace('\\', Path.DirectorySeparatorChar); - - // TODO: This is a temporary error because we switched from IOHelper.MapPath to HostingEnvironment.MapPathXXX - // IOHelper would check if the path passed in started with the root, and not prepend the root again if it did, - // however if you are requesting a path be mapped, it should always assume the path is relative to the root, not - // absolute in the file system. This error will help us find and fix improper uses, and should be removed once - // all those uses have been found and fixed - if (newPath.StartsWith(root)) - { - throw new ArgumentException( - "The path appears to already be fully qualified. Please remove the call to MapPathWebRoot"); - } - - return Path.Combine(root, newPath.TrimStart(Constants.CharArrays.TildeForwardSlashBackSlash)); - } - } -} diff --git a/Our.Umbraco.TagHelpers/MacroTagHelper.cs b/Our.Umbraco.TagHelpers/MacroTagHelper.cs deleted file mode 100644 index 46f2c8d..0000000 --- a/Our.Umbraco.TagHelpers/MacroTagHelper.cs +++ /dev/null @@ -1,71 +0,0 @@ -using System.Collections.Generic; -using System.Linq; -using System.Threading.Tasks; -using Microsoft.AspNetCore.Razor.TagHelpers; -using Umbraco.Cms.Core.Models.PublishedContent; -using Umbraco.Cms.Core.Templates; -using Umbraco.Cms.Core.Web; - -namespace Our.Umbraco.TagHelpers -{ - /// - /// Render Umbraco Macros in your views - /// - [HtmlTargetElement("our-macro")] - public class MacroTagHelper : TagHelper - { - private readonly IUmbracoComponentRenderer _umbracoComponentRenderer; - private readonly IUmbracoContextAccessor _umbracoContextAccessor; - - /// - /// The alias of the Macro to execute - /// - [HtmlAttributeName("alias")] - public string? MacroAlias { get; set; } - - /// - /// An optional attribute to set the context of the Content that the Macro will use - /// Without it set it will use the current page - /// - [HtmlAttributeName("content")] - public IPublishedContent? ContentNode { get; set; } - - /// - /// An optional list of attributes that will map to Macro Parameters - /// bind:myMacroParam="" bind:startNodeId="" etc... - /// - [HtmlAttributeName(DictionaryAttributePrefix = "bind:")] - public IDictionary? MacroParameters { get; set; } = new Dictionary(); - - public MacroTagHelper(IUmbracoComponentRenderer umbracoComponentRenderer, IUmbracoContextAccessor umbracoContextAccessor) - { - _umbracoComponentRenderer = umbracoComponentRenderer; - _umbracoContextAccessor = umbracoContextAccessor; - } - - public override async Task ProcessAsync(TagHelperContext context, TagHelperOutput output) - { - output.TagName = ""; // Remove the outer tag - - if (ContentNode is null) - { - // Get the current page/published request IPublishedContent for the content/context to run the Macro in - if (_umbracoContextAccessor.TryGetUmbracoContext(out var umbracoContext)) - { - ContentNode = umbracoContext.PublishedRequest.PublishedContent; - } - } - - // TagHelpers dont seem to like HTMLAttributes as dictionary - // Hence us trying to convert it here - IDictionary macroParams = new Dictionary(); - if (MacroParameters != null && MacroParameters.Any()) - { - macroParams = MacroParameters.ToDictionary(p => p.Key, p => (object)p.Value); - } - - var macroResult = await _umbracoComponentRenderer.RenderMacroForContent(ContentNode, MacroAlias, macroParams); - output.Content.SetHtmlContent(macroResult.ToHtmlString()); - } - } -} diff --git a/Our.Umbraco.TagHelpers/Notifications/InlineSvgTagHelperNotifications.cs b/Our.Umbraco.TagHelpers/Notifications/InlineSvgTagHelperNotifications.cs index 93a27c0..0c4fc53 100644 --- a/Our.Umbraco.TagHelpers/Notifications/InlineSvgTagHelperNotifications.cs +++ b/Our.Umbraco.TagHelpers/Notifications/InlineSvgTagHelperNotifications.cs @@ -1,13 +1,9 @@ using Microsoft.Extensions.Logging; using System; -using System.Collections.Generic; using System.Linq; -using System.Text; -using System.Threading.Tasks; using Umbraco.Cms.Core.Cache; using Umbraco.Cms.Core.Events; using Umbraco.Cms.Core.Notifications; -using Umbraco.Extensions; namespace Our.Umbraco.TagHelpers.Notifications { diff --git a/Our.Umbraco.TagHelpers/Our.Umbraco.TagHelpers.csproj b/Our.Umbraco.TagHelpers/Our.Umbraco.TagHelpers.csproj index 69c8232..6c357aa 100644 --- a/Our.Umbraco.TagHelpers/Our.Umbraco.TagHelpers.csproj +++ b/Our.Umbraco.TagHelpers/Our.Umbraco.TagHelpers.csproj @@ -1,7 +1,7 @@  - net5.0;net6.0; + net9.0; @@ -33,15 +33,15 @@ - - - - - - + + + + + + - - + + diff --git a/Our.Umbraco.TagHelpers/SelfHostTagHelper.cs b/Our.Umbraco.TagHelpers/SelfHostTagHelper.cs index 657ef06..5794f41 100644 --- a/Our.Umbraco.TagHelpers/SelfHostTagHelper.cs +++ b/Our.Umbraco.TagHelpers/SelfHostTagHelper.cs @@ -48,7 +48,5 @@ public override async Task ProcessAsync(TagHelperContext context, TagHelperOutpu output.Attributes.Remove(new TagHelperAttribute("folder")); output.Attributes.Remove(new TagHelperAttribute("ext")); } - - } } diff --git a/Our.Umbraco.TagHelpers/Services/SelfHostService.cs b/Our.Umbraco.TagHelpers/Services/SelfHostService.cs index a83cb30..17a3f1a 100644 --- a/Our.Umbraco.TagHelpers/Services/SelfHostService.cs +++ b/Our.Umbraco.TagHelpers/Services/SelfHostService.cs @@ -1,7 +1,6 @@ using Microsoft.AspNetCore.Hosting; using Microsoft.Extensions.Options; using Our.Umbraco.TagHelpers.Configuration; -using Our.Umbraco.TagHelpers.Extensions; using Our.Umbraco.TagHelpers.Models; using System; using System.IO; diff --git a/Our.Umbraco.TagHelpers/Utils/StringUtils.cs b/Our.Umbraco.TagHelpers/Utils/StringUtils.cs index 016e3b2..eb78d31 100644 --- a/Our.Umbraco.TagHelpers/Utils/StringUtils.cs +++ b/Our.Umbraco.TagHelpers/Utils/StringUtils.cs @@ -1,8 +1,4 @@ using System; -using System.Collections.Generic; -using System.Linq; -using System.Text; -using System.Threading.Tasks; namespace Our.Umbraco.TagHelpers.Utils { diff --git a/README.md b/README.md index a0f5850..58735f3 100644 --- a/README.md +++ b/README.md @@ -73,20 +73,8 @@ This is a tag helper attribute that can be applied to any DOM element in the raz ## `` -This tag helper element `` will render an Umbraco Macro Partial View and will use the current page/request for the Macro rendering & context. - -If you wish, you can modify this behaviour and pass the context/content node that the Macro will render with using an optional attribute `content` on the `` tag and passing an `IPublishedContent` into the attribute. This allows the same Macro Partial View Macro code/snippet to work in various scenarios when the content node/context is changed. - -Additionally custom Macro Parameters that can be passed through and consumed by Macro Partial Views are specified in the following way. The key/alias of the Macro Parameter must be prefixed with the following `bind:` - -So to pass/set a value for the macro parameter `startNodeId` then I will need to set an attribute on the element as follows `bind:startNodeId` - -```cshtml - - - - -``` +> [!WARNING] +> The tag helper element `` has been removed in version 2.0.0 since Umbraco 14.0.0 deprecated the use of macros. ## BeginUmbracoForm Replacement