Press Ctrl / CMD + C to copy this to your clipboard.
Copied to clipboard
Flag this post as spam?
This post will be reported to the moderators as potential spam to be looked at
Topic author was deleted
Sep 01, 2014 @ 16:30
RelatedLinks in 7.0.4
Hi,
I've found some answers regarding RelatedLinks, but they all seem to be using a version around 4.7, and either something has changed with the process since then, or I'm looking for the wrong things.
I have a doctype which has a data type of Related Links. I want to get these related links and parse through them one by one. If I do:
@item.GetProperty("informationNuggets").Value
and push that out to a page, I get what looks like a JSON array. However, if I try something like this:
foreach (var nugget in @item.informationNuggets){}
I get an error, "CS1061: 'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'informationNuggets' and no extension method 'informationNuggets' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)"
Could someone point me in the right direction for this? I've attached my complete code so far. This is in a Razor template as well, FYI:
If you take a look at the documentation for the v7 Related Links picker it has Razor snippets for both dynamic model and the typed one. I would suggest you try the dynamic one.
I would highly recommend an upgrade to Umbraco v7.1.6 as there are a lot of improvements and fixes since v7.0.4.
Topic author was deleted
RelatedLinks in 7.0.4
Hi,
I've found some answers regarding RelatedLinks, but they all seem to be using a version around 4.7, and either something has changed with the process since then, or I'm looking for the wrong things.
I have a doctype which has a data type of Related Links. I want to get these related links and parse through them one by one. If I do:
and push that out to a page, I get what looks like a JSON array. However, if I try something like this:
I get an error, "
CS1061: 'Umbraco.Core.Models.IPublishedContent' does not contain a definition for 'informationNuggets' and no extension method 'informationNuggets' accepting a first argument of type 'Umbraco.Core.Models.IPublishedContent' could be found (are you missing a using directive or an assembly reference?)
"Could someone point me in the right direction for this? I've attached my complete code so far. This is in a Razor template as well, FYI:
Any advice would be very much appreciated :)
Hi Ed,
If you take a look at the documentation for the v7 Related Links picker it has Razor snippets for both dynamic model and the typed one. I would suggest you try the dynamic one.
I would highly recommend an upgrade to Umbraco v7.1.6 as there are a lot of improvements and fixes since v7.0.4.
Regards,
Jeavon
Comment author was deleted
Hi Jeavon,
Thank you very much for your reply - that documentation was exactly what I was looking for - not sure how I missed that!
Thanks, Ed
Np, also if you upgrade to v7.1.6 you will have the option to reorder the related links!
is working on a reply...