You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: 15/umbraco-cms/reference/content-type-filters.md
+64-11Lines changed: 64 additions & 11 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -1,5 +1,5 @@
1
1
---
2
-
description: Describes how to use Content Type Filters to restrict the allowed content options available to editors.
2
+
description: Describes how to use Allowed Content Type Filters to restrict the allowed content options available to editors.
3
3
---
4
4
5
5
# Filtering Allowed Content Types
@@ -23,27 +23,45 @@ There are two methods you can implement:
23
23
* One for filtering the content types allowed at the content root
24
24
* One for the content types allowed below a given parent node.
25
25
26
-
If you don't want to filter using one of the two approaches, you can return the provided collection unmodified.
26
+
If you don't want to filter using one of the two approaches, you can omit the implementation of that method. The default implementation will return the provided collection unmodified.
27
27
28
28
### Example Use Case
29
29
30
-
The following example shows a typical use case. Often websites will have a "Home Page" Document Type which is created at the root. Normally, only one of these is required. You can enforce that using the following Content Type Filter.
30
+
The following example shows an illustrative but also typical use case. Often websites will have a "Home Page" Document Type which is created at the root. Normally, only one of these is required. You can enforce that using the following Content Type Filter.
31
31
32
-
The code below is querying the existing content available at the root. Normally you can create a "Home Page" here, but if one already exists that option is removed:
32
+
The code below is querying the existing content available at the root. Normally you can create a "Home Page" here, but if one already exists that option is removed.
33
+
34
+
It then shows how to limit the allowed children by only permitting a single "Landing Page" under the "Home Page" Document Type.
Copy file name to clipboardExpand all lines: 15/umbraco-cms/reference/routing/request-pipeline/outbound-pipeline.md
+14-7Lines changed: 14 additions & 7 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -16,23 +16,30 @@ To explain things we will use the following content tree:
16
16
17
17
## 1. Create segments
18
18
19
-
When the URL is constructed, Umbraco will convert every node in the tree into a segment. Each published Content item has a corresponding URL segment.
19
+
When the URL is constructed, Umbraco will convert every document node in the tree into a segment. Each published document has a corresponding URL segment.
20
20
21
21
In our example "Our Products" will become "our-products" and "Swibble" will become "swibble".
22
22
23
23
The segments are created by the "Url Segment provider"
24
24
25
25
### Url Segment Provider
26
26
27
-
The DI container of an Umbraco implementation contains a collection of `UrlSegmentProviders`. This collection is populated during Umbraco boot up. Umbraco ships with a 'DefaultUrlSegmentProvider' - but custom implementations can be added to the collection.
27
+
The DI container of an Umbraco implementation contains a collection of `UrlSegmentProviders`. This collection is populated during Umbraco start up. Umbraco ships with a `DefaultUrlSegmentProvider` and custom implementations can be added to the collection.
28
28
29
-
When the `GetUrlSegment` extension method is called for a content item + culture combination, each registered `IUrlSegmentProvider` in the collection is executed in 'collection order'. This continues until a particular `UrlSegmentProvider` returns a segment value for the content, and no further `UrlSegmentProviders` in the collection will be executed. If no segment is returned by any provider in the collection a `DefaultUrlSegmentProvider` will be used to create a segment. This ensures that a segment is always created, like when a default provider is removed from a collection without a new one being added.
29
+
When the segments are requested for a document and culture combination, each registered `IUrlSegmentProvider` in the collection is executed in _collection order_. Each provider can provide a segment for the document and culture or return `null`.
30
+
31
+
Each URL segment provider is configured either to terminate after providing a segment or to allow other segment providers to be executed. When a terminating provider returns a segment value for the document and culture, no further `UrlSegmentProviders` in the collection will be executed.
32
+
33
+
If the provider does not terminate, other providers can also return segments. In this way, multiple segments can be returned for a single document and culture combination. Along with the use of custom `IUrlProvider` and `IContentFinder` instances, considerable flexibility in the generated URLs can be achieved.
34
+
35
+
If no segment is returned by any provider in the collection, a `DefaultUrlSegmentProvider` will be used to create a segment. This ensures that a segment is always created, even when a default provider has been removed from the collection without a new one being added.
30
36
31
37
To create a new Url Segment Provider, implement the following interface:
0 commit comments