Our.Umbraco.Skipper 1.0.1

Suggested Alternatives

Our.Umbraco.Skipper 1.1.2

Additional Details

Some features are not working as expected.

There is a newer version of this package available.
See the version list below for details.
dotnet add package Our.Umbraco.Skipper --version 1.0.1
NuGet\Install-Package Our.Umbraco.Skipper -Version 1.0.1
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="Our.Umbraco.Skipper" Version="1.0.1" />
For projects that support PackageReference, copy this XML node into the project file to reference the package.
paket add Our.Umbraco.Skipper --version 1.0.1
#r "nuget: Our.Umbraco.Skipper, 1.0.1"
#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.
// Install Our.Umbraco.Skipper as a Cake Addin
#addin nuget:?package=Our.Umbraco.Skipper&version=1.0.1

// Install Our.Umbraco.Skipper as a Cake Tool
#tool nuget:?package=Our.Umbraco.Skipper&version=1.0.1

Our.Umbraco.Skipper

An Umbraco package that lets you specify nodes and document types that will be excluded from Umbraco's URL generation.

This project is exclusively for Umbraco 9+. This project is a port for v9, taken from the original Umbraco-VirtualNodes by sotirisf.

Installation

dotnet add package Our.Umbraco.Skipper
dotnet build
dotnet run

How it works?

Our.Umbraco.Skipper can work with a single node or multiple nodes to be skipped from Umbraco's URL generation.
Some examples (between parentheses the URL segment):

root (en)
    products (products)
        category (category) <-- this is Skipper's work
            product1 (product1)
            product2 (product2)
            product3 (product3)

Product URLs will be for example /en/products/product1.
Skipper's work URLs without Hide Skipper's work:

  • Category: /en/products/category

Skipper's work URLs with Hide Skipper's work:

  • Category: No URL
root (en)
    services (services) <-- this is Skipper's work
        products (products)
            category (category) <-- this is Skipper's work
                product1 (product1)
                product2 (product2)
                product3 (product3)

Product URLs will be for example /en/products/product2. Skipper's work URLs without Hide Skipper's work:

  • Services: /en/services
  • Category: /en/products/category

Skipper's work URLs with Hide Skipper's work:

  • Services: No URL
  • Category: No URL
root (en)
    services (services) <-- this is Skipper's work
        products (products) <-- this is Skipper's work
            category (category)
                product1 (product1)
                product2 (product2)
                product3 (product3)

Product URLs will be for example /en/category/product3. Skipper's work URLs without Hide Skipper's work:

  • Services: /en/services
  • Category: /en/products

Skipper's work URLs with Hide Skipper's work:

  • Services: No URL
  • Category: No URL

Configuration

Skipper's configuration uses for the most part the new .NET 5 IConfiguration, so we will modify for the most part the file appsettings.json. Configuration will work between environments, so if you want to change some options for development, you can do it.

Root configuration node

The main configuration node is inside Umbraco's configuration (at the same level of CMS configuration, for reference):

{
    "$schema": "",
    "Umbraco": {
        "Skipper": {
            // Skipper's config goes here
        }
    }
}

Aliases

Same process of sotirisf's old v8: you specify doc type aliases in the configuration, and all nodes will be treated by Skipper:

{
    "$schema": "",
    "Umbraco": {
        "Skipper": {
            "Aliases": [
                "myDocTypeAlias1",
                "myDocTypeAlias2"
            ]
        }
    }
}

Hide Skipper's work

By default Skipper will skip the specified segment URL for the node's children, but for the node itself it will still generate the URL. You can force Skipper to return 404 for all nodes, this way:

{
    "$schema": "",
    "Umbraco": {
        "Skipper": {
            "HideSkipperWork": true
        }
    }
}

Additional options

To prevent infinite looping, I've added a check that after 50 (by default) iterations, while loops will break automatically. If you have some troubles on large-scale websites, you might need to increment this value:

{
    "$schema": "",
    "Umbraco": {
        "Skipper": {
            "WhileLoopMaxCount": 50
        }
    }
}

Reserved property aliases

Working the same way as specified in the Special Property Type aliases for routing, i've added some property aliases configuration to granularly control each node.
Keep in mind that umbracoUrlName and umbracoUrlAlias are compatible with Skipper, but with some drawbacks (see here).

umbracoUrlSkipper

Creating a property alias with this name and using a True/False property editor lets you control for the node if it should be controller by Skipper or not.

umbracoHideSkipperWork

Creating a property alias with this name and using a True/False property editor lets you control for the node (if it's being controlled by Skipper) if the node should be hidden (and no URL will be generated) or not.

Duplicates check

Consider the following example:

articles
    skipperWork1
        article1
        article2
    skipperWork2

Supposing that skipperWork1 and skipperWork2 are Skipper's work, the path for article1 will be articles/article1. But what if we add a new article named article1 under skipperWork2?
Our.Umbraco.Skipper checks nodes on save and changes their names accordingly to protect your URLs from this.
So, if you saved a new node named article1 under skipperWork2 it would become:

articles
    skipperWork1
        article1
        article2
    skipperWork2
        article1 (1) 

And then if you create another node named article1 back under skipperWork1 it would become article1 (2):

articles
    skipperWork1
        article1
        article2
        article1 (2)
    skipperWork2
        article1 (1) 

This ensures that there will be no duplicate node names. Diffrently from sotirisf's old v8, Our.Umbraco.Skipper will check for ALL Skipper's work nodes, so you don't have to worry even if the nodes are on different levels but reference to the same root node.

Important

The duplicate check will NOT directly check URLs, so if you use umbracoUrlName or umbracoUrlAlias you still have to check them yourself, even tho they work in the URL-generation.

Product Compatible and additional computed target framework versions.
.NET net5.0 is compatible.  net5.0-windows was computed.  net6.0 was computed.  net6.0-android was computed.  net6.0-ios was computed.  net6.0-maccatalyst was computed.  net6.0-macos was computed.  net6.0-tvos was computed.  net6.0-windows was computed.  net7.0 was computed.  net7.0-android was computed.  net7.0-ios was computed.  net7.0-maccatalyst was computed.  net7.0-macos was computed.  net7.0-tvos was computed.  net7.0-windows was computed.  net8.0 was computed.  net8.0-android was computed.  net8.0-browser was computed.  net8.0-ios was computed.  net8.0-maccatalyst was computed.  net8.0-macos was computed.  net8.0-tvos was computed.  net8.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
1.1.4 1,254 7/19/2023
1.1.3 2,650 7/12/2022
1.1.2 1,315 2/7/2022
1.1.1 609 2/7/2022
1.1.0 613 1/25/2022
1.0.1 619 1/24/2022
1.0.0 739 11/17/2021