Created
January 31, 2017 21:28
-
-
Save soen/99d49db0e57bc69c63e257100d6a9782 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
protected virtual string GetInternalUrl(Database database, string url, string itemID, string anchor, string queryString) | |
{ | |
// Asserts omitted... | |
Item obj = database.Items[url] ?? database.Items[itemID]; | |
if (obj == null) | |
return string.Empty; | |
if (obj.Paths.IsMediaItem) | |
return this.GetMediaUrl(database, itemID); | |
return new UrlString(LinkManager.GetItemUrl(obj, XslHelper.GetUrlOptions())) | |
{ | |
Parameters = { | |
new UrlString(queryString).Parameters | |
}, | |
Hash = anchor | |
}.GetUrl(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment