Created
October 28, 2013 15:55
-
-
Save csharpforevermore/7199434 to your computer and use it in GitHub Desktop.
Umbraco 6 - Razor - Global helper wrapper method for rending a hyperlink
This file contains hidden or 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
@helper RenderLink(string href, string title, string target, string text) | |
{ | |
<a href="@(href)" title="@(title)" target="@(target)">@(text)</a> | |
} |
This file contains hidden or 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
@if (Model.footerLinks.Any()) | |
{ | |
foreach (var footerLink in Model.footerLinks) | |
{ | |
@RenderLink(footerLink.Url, footerLink.Title, (footerLink.NewWindow ? "_self" : "_blank"), footerLink.Title) | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment