Phantasmal.Umbraco.VariantDeleter 1.1.0

The owner has unlisted this package. This could mean that the package is deprecated, has security vulnerabilities or shouldn't be used anymore.
dotnet add package Phantasmal.Umbraco.VariantDeleter --version 1.1.0
                    
NuGet\Install-Package Phantasmal.Umbraco.VariantDeleter -Version 1.1.0
                    
This command is intended to be used within the Package Manager Console in Visual Studio, as it uses the NuGet module's version of Install-Package.
<PackageReference Include="Phantasmal.Umbraco.VariantDeleter" Version="1.1.0" />
                    
For projects that support PackageReference, copy this XML node into the project file to reference the package.
<PackageVersion Include="Phantasmal.Umbraco.VariantDeleter" Version="1.1.0" />
                    
Directory.Packages.props
<PackageReference Include="Phantasmal.Umbraco.VariantDeleter" />
                    
Project file
For projects that support Central Package Management (CPM), copy this XML node into the solution Directory.Packages.props file to version the package.
paket add Phantasmal.Umbraco.VariantDeleter --version 1.1.0
                    
#r "nuget: Phantasmal.Umbraco.VariantDeleter, 1.1.0"
                    
#r directive can be used in F# Interactive and Polyglot Notebooks. Copy this into the interactive tool or source code of the script to reference the package.
#:package Phantasmal.Umbraco.VariantDeleter@1.1.0
                    
#:package directive can be used in C# file-based apps starting in .NET 10 preview 4. Copy this into a .cs file before any lines of code to reference the package.
#addin nuget:?package=Phantasmal.Umbraco.VariantDeleter&version=1.1.0
                    
Install as a Cake Addin
#tool nuget:?package=Phantasmal.Umbraco.VariantDeleter&version=1.1.0
                    
Install as a Cake Tool

Variant deleter

NuGet

An Umbraco 17 extension that adds a Delete Variant action to the document tree. It removes the selected language's variant from a document and returns the node to the bracketed NotCreated state, as if the variant had never existed.

Umbraco core can only unpublish a culture, which leaves a draft that still shows in the tree (see Umbraco-CMS #9735). This extension closes that gap. It ships the backoffice UI and the server API.

Install

dotnet add package Phantasmal.Umbraco.VariantDeleter

Restart the site. The VariantDeleterComposer registers the service, the controller, and the backoffice extension automatically. No configuration is required.

How it works

VariantDeleterService removes a culture variant. It guards the default and mandatory languages, unpublishes the culture if needed, clears the content schedule, nulls the variant property values, then calls SetCultureName(null, culture) and saves. VariantController exposes DELETE /umbraco/management/api/v1/variant/{id}?culture={isoCode} and checks the user's Delete permission on the document.

The frontend registers an entity action on the document type (weight 490, below Unpublish), gated by the Umb.Document.Delete permission. It validates the variant, asks for confirmation, calls the endpoint, and refreshes the tree.

Notes

There is no recycle bin for variants, so the action cannot be undone and the confirmation says so. Clearing a variant value nulls the editor data but does not delete the underlying rows from umbracoPropertyData. To an editor the variant is gone.

Build the frontend

cd src/Phantasmal.Umbraco.VariantDeleter/Client
npm install
npm run build

The output goes to wwwroot/App_Plugins/VariantDeleter/dist. A built copy is committed.

Pack

dotnet pack src/Phantasmal.Umbraco.VariantDeleter/Phantasmal.Umbraco.VariantDeleter.csproj -c Release

Compatibility

Umbraco 17.3 and later. Requires a multi-language site with culture variation enabled.

Licence

MIT. See LICENSE.

Product Compatible and additional computed target framework versions.
.NET net10.0 is compatible.  net10.0-android was computed.  net10.0-browser was computed.  net10.0-ios was computed.  net10.0-maccatalyst was computed.  net10.0-macos was computed.  net10.0-tvos was computed.  net10.0-windows was computed. 
Compatible target framework(s)
Included target framework(s) (in package)
Learn more about Target Frameworks and .NET Standard.

NuGet packages

This package is not used by any NuGet packages.

GitHub repositories

This package is not used by any popular GitHub repositories.

Version Downloads Last Updated