DocumentUrlContext.TryTransformSiteRelativeUrl Method

Namespace
Kampute.DocToolkit.Routing
Assembly
  • Kampute.DocToolkit.dll

Definition

Attempts to transform a site-relative URL string into an absolute or document-relative URL based on the current context.
public abstract bool TryTransformSiteRelativeUrl(string siteRelativeUrl, [NotNullWhen(true)] out string transformedUrl)

Parameters

siteRelativeUrl string
The URL string relative to site root to transform.
transformedUrl string
When this method returns, contains the transformed URL if the transformation succeeded; otherwise, null.

Returns

bool
true if the URL was successfully transformed; otherwise, false.

Remarks

This method transforms URLs that are specified relative to the site root into URLs that work correctly when referenced from the current context, regardless of the document's depth in the documentation hierarchy.