Created
February 28, 2018 00:44
-
-
Save seanrco/290d5c4cc88cdee2b207d8693c0c9ef4 to your computer and use it in GitHub Desktop.
_Functions addition for getting Link Target attribute.
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
/// <summary> | |
/// Get a link's action suitable for use in the 'a' attribute. | |
/// </summary> | |
/// <param name="link">Link element</param> | |
/// <param name="url">Url helper</param> | |
/// <returns>Link action</returns> | |
public static string GetLinkTarget(ICMSLinkElement link, UrlHelper url) | |
{ | |
String linkUrl = ""; | |
if (link != null) | |
{ | |
linkUrl = (!String.IsNullOrWhiteSpace(link.GetAttributeValue("CustomURLTarget"))) ? link.GetAttributeValue("CustomURLTarget") : link.GetAttributeValue("Target"); | |
} | |
//remove tfrm=4 for page preview | |
return linkUrl; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment