Press Ctrl / CMD + C to copy this to your clipboard.
This post will be reported to the moderators as potential spam to be looked at
Hello everybodyCan someone help me with a simple Razor snippet for showing links from the build in Related Links in Umbraco?Thanks in advance!//René
I have just figured it out. But i can't delete this topic, so do not spend time answering this topic. :-)@inherits umbraco.MacroEngines.DynamicNodeContext
@{ if (Model.HasProperty("relatedLinks")) {<ul class="side-nav">@foreach (var link in @Model.RelatedLinks){ string target = link.newwindow == "1" ? " target=\"_blank\"" : "";<li>@if (link.type == "internal"){<a href="@umbraco.library.NiceUrl(int.Parse(link.link))"@Html.Raw(target)>@link.title</a>}else{<a href="@link.link"@Html.Raw(target)>@link.title</a>}</li>}</ul> }}
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.
Continue discussion
I need a simple Razor snippet for showing related links
Hello everybodyCan someone help me with a simple Razor snippet for showing links from the build in Related Links in Umbraco?Thanks in advance!//René
I have just figured it out. But i can't delete this topic, so do not spend time answering this topic. :-)
@inherits umbraco.MacroEngines.DynamicNodeContext
@{
if (Model.HasProperty("relatedLinks"))
{
<ul class="side-nav">
@foreach (var link in @Model.RelatedLinks)
{
string target = link.newwindow == "1" ? " target=\"_blank\"" : "";
<li>
@if (link.type == "internal")
{
<a href="@umbraco.library.NiceUrl(int.Parse(link.link))"@Html.Raw(target)>@link.title</a>
}
else
{
<a href="@link.link"@Html.Raw(target)>@link.title</a>
}
</li>
}
</ul>
}
}
is working on a reply...
This forum is in read-only mode while we transition to the new forum.
You can continue this topic on the new forum by tapping the "Continue discussion" link below.