Interface IPublishedContentCache
Namespace: Umbraco.Web.PublishedCache
Assembly: Umbraco.Web.dll
Syntax
public interface IPublishedContentCache : IPublishedCache, IXPathNavigable
Methods
View SourceGetByRoute(Boolean, String, Nullable<Boolean>, String)
Gets content identified by a route.
Declaration
IPublishedContent GetByRoute(bool preview, string route, bool? hideTopLevelNode = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.String | route | The route |
System.Nullable<System.Boolean> | hideTopLevelNode | A value forcing the HideTopLevelNode setting. |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
A valid route is either a simple path eg /foo/bar/nil
or a root node id and a path, eg 123/foo/bar/nil
.
If is null
then the settings value is used.
The value of preview
overrides defaults.
GetByRoute(String, Nullable<Boolean>, String)
Gets content identified by a route.
Declaration
IPublishedContent GetByRoute(string route, bool? hideTopLevelNode = null, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.String | route | The route |
System.Nullable<System.Boolean> | hideTopLevelNode | A value forcing the HideTopLevelNode setting. |
System.String | culture |
Returns
Type | Description |
---|---|
IPublishedContent | The content, or null. |
Remarks
A valid route is either a simple path eg /foo/bar/nil
or a root node id and a path, eg 123/foo/bar/nil
.
If is null
then the settings value is used.
Considers published or unpublished content depending on defaults.
GetRouteById(Boolean, Int32, String)
Gets the route for a content identified by its unique identifier.
Declaration
string GetRouteById(bool preview, int contentId, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Boolean | preview | A value indicating whether to consider unpublished content. |
System.Int32 | contentId | The content unique identifier. |
System.String | culture |
Returns
Type | Description |
---|---|
System.String | A special string formatted route path. |
Remarks
The resulting string is a special encoded route string that may contain the domain ID for the current route. If a domain is present the string will be prefixed with the domain ID integer, example: {domainId}/route-path-of-item
The value of preview
overrides defaults.
GetRouteById(Int32, String)
Gets the route for a content identified by its unique identifier.
Declaration
string GetRouteById(int contentId, string culture = null)
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | contentId | The content unique identifier. |
System.String | culture |
Returns
Type | Description |
---|---|
System.String | A special string formatted route path. |
Remarks
Considers published or unpublished content depending on defaults.