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
I have used the related link data type on multiple projects and have had never had any issues until now. I have recently installed Umbraco version 7.7.2 assembly: 1.0.6484.21641 and use the following (cut down version) code to display a link specified in the back office
var siteRoot = Model.Content.AncestorOrSelf("homePage");
var carouselLandingPage = siteRoot.Descendant("carouselLandingPage");
<div class="carousel-inner text-center">
@foreach (var carouselSlide in carouselLandingPage.Children)
foreach (var link in carouselSlide.GetPropertyValue<JArray>("buttonLink"))
var linkUrl = (link.Value<bool>("isInternal")) ? Umbraco.NiceUrl(link.Value<int>("internal")) : link.Value<string>("link");
var linkTarget = link.Value<bool>("newWindow") ? "_blank" : null;
<a title="@(link.Value<string>("caption"))" href="@linkUrl" target="@linkTarget" class="btn btn-white btn-lg">@(link.Value<string>("caption"))</a>
Whenever i specifiy an internal umbraco page i get the following
However, when i specify an external link (see below) there is no problems and everything works perfectly
Is this a bug or is there an issue with something im doing? I have used this code (taken from https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/related-links) on multiple projects and never had an issue before?
As the link to that property editor says, that type is now obsolete. Refactor your code to the updated Related Link type as found here:
Thanks for responding!
Thanks a very good point, totally missed the 'H1' obselete info :)!
Ill refactor my code using the link you provided.
Just to follow up i implemented the code from the link Barry provided (https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Related-Links2) and this now works as expected.
Couple of points
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted