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 Devs, I´m trying to implement relations between nodes using Umbraco Relation Editor, in the backoffice I can see the relation that I have created, but I'm having problems when I try to get the values.
Code
@foreach (var item in Model.Content.Related<IPublishedContent>("relationType")) { <p> @item .Name </p> }
When I run the project it doesn't show me any values.
I´m using Umbraco 7.2.1 and Umbraco Relation Editor 1.1.5550
Best regards
Hi,
Is "relationType" the actual name of your relation type ?
You can go in to developer section and find the relation types tree. You need to pass in the exact alias of the relation type :
Dave
Hi Dave,
Yes, it is Dave. The only thing different in my relation is that the Direction value is Bidirectional.
Best Regards
Does it work when you change it to Parent to child ?
If that works you should create a issue here : https://github.com/lars-erik/umbraco-relation-editor
dave
Nope, still returning nothing.
I try to test this line
var relatedBlogposts = Model.Content.Related
and is returning
System.Linq.Enumerable+OfTypeIterator>d__93`1[Umbraco.Core.Models.IPublishedContent]
Hi Vanilson,
I have a similar issue with no results. Did you make any progress with this?
I hope to use the Relation API to relate content items e.g. the annual report of 2018 is related to the annual report of 2017 and vice versa
Thanks Jonny
is working on a reply...
Write your reply to:
Upload image
Image will be uploaded when post is submitted
Relation Types Umbraco
Hi Devs, I´m trying to implement relations between nodes using Umbraco Relation Editor, in the backoffice I can see the relation that I have created, but I'm having problems when I try to get the values.
Code
When I run the project it doesn't show me any values.
I´m using Umbraco 7.2.1 and Umbraco Relation Editor 1.1.5550
Best regards
Hi,
Is "relationType" the actual name of your relation type ?
You can go in to developer section and find the relation types tree. You need to pass in the exact alias of the relation type :
Dave
Hi Dave,
Yes, it is Dave. The only thing different in my relation is that the Direction value is Bidirectional.
Best Regards
Does it work when you change it to Parent to child ?
If that works you should create a issue here : https://github.com/lars-erik/umbraco-relation-editor
dave
Hi Dave,
Nope, still returning nothing.
I try to test this line
and is returning
Best regards
Hi Vanilson,
I have a similar issue with no results. Did you make any progress with this?
I hope to use the Relation API to relate content items e.g. the annual report of 2018 is related to the annual report of 2017 and vice versa
Thanks Jonny
is working on a reply...