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
Hi guys, im using razor macro engine to get the INTERNAL related links in a document.
Is any way to get the values(properties + id) of these internal links?
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@if(Model.Content.HasValue("selectRelatedLinks"))
{
@foreach (var item in CurrentPage.selectRelatedLinks)
var linkUrl = (item.Value<bool>("isInternal")) ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.Value<string>("link");
var linkTarget = item.Value<bool>("newWindow") ? "_blank" : null;
<span class="Internal LInks">
<a href="@linkUrl" target="@linkTarget">
<img alt="@(item.Value<string>("caption"))" class="img-responsive" src="@(item.IMAGE))">
</a>
</span>
}
i want to bring the item image of each intnral link.
I ve got it. I give my code, if someone needs help with that.
@foreach (var item in CurrentPage.selectRelatedProducts) { var linkUrl = (item.Value<bool>("isInternal")) ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.Value<string>("link"); var linkTarget = item.Value<bool>("newWindow") ? "_blank" : null; var itemId= ((item.Value<bool>("isInternal")) ? item.Value<int>("internal") : null); if(itemId != null) { Node myNode = new Node(itemId); string nodetitle = item.Value<string>("caption"); if (myNode.GetProperty("producttitle") != null) { nodetitle = myNode.GetProperty("producttitle").Value; } var nodeimg = "/img/no_image.jpg"; if (myNode.GetProperty("productimg") != null) { nodeimg = myNode.GetProperty("productimg").Value; } <li> <span> <a href="@linkUrl" target="@linkTarget"> <span class=""> <span class=""> <span><i class=""></i> @umbraco.library.GetDictionaryItem("ProductPreview")</span> </span> <img alt="@(item.Value<string>("caption"))" class="img-responsive" src="@nodeimg"> </span> </a> <span class=""> <a href="@linkUrl" target="@linkTarget"> <h4>@nodetitle</h4> </a> </span> </li> } }
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Related Links Values
Hi guys, im using razor macro engine to get the INTERNAL related links in a document.
Is any way to get the values(properties + id) of these internal links?
@inherits Umbraco.Web.Mvc.UmbracoTemplatePage
@if(Model.Content.HasValue("selectRelatedLinks"))
{
@foreach (var item in CurrentPage.selectRelatedLinks)
{
var linkUrl = (item.Value<bool>("isInternal")) ? Umbraco.NiceUrl(item.Value<int>("internal")) : item.Value<string>("link");
var linkTarget = item.Value<bool>("newWindow") ? "_blank" : null;
<span class="Internal LInks">
<a href="@linkUrl" target="@linkTarget">
<img alt="@(item.Value<string>("caption"))" class="img-responsive" src="@(item.IMAGE))">
</a>
</span>
}
}
i want to bring the item image of each intnral link.
I ve got it. I give my code, if someone needs help with that.
is working on a reply...