Edit this topic

Url helper

: shell

: url-helper

: content

: /modules/core/content/services/url-helper.js

: https://github.com/DecentCMS/DecentCMS/blob/master/modules/core/content/services/url-helper.js

class: UrlHelper

new UrlHelper()

Utilities to manipulate content item URLs.

urlHelper.getUrl(id) ⇒ string

Gets the URL for a content item by asking all middleware.

Returns: string - The URL for the content item.

Param Type Description
id string The id of the content item.

urlHelper.getId(url) ⇒ string

Gets the content item ID for a URL, if the URL corresponds to a content-item, by asking all middleware.

Returns: string - The content item ID for the URL, or null if none was found.

Param Type Description
url string The URL to resolve.