I did earlier, and love it. The only thing that Related Links is lacking is the ability to link to documents stored in the Media section. I'm going to have editors wanting to link multiple documents onto any given content node. This is the "only" reason why I am messing with the Multi URL Picker.
Multi Url Picker - Object reference not set on instance of object
I am currently in a vanilla Umbraco 7.6.7 install, with the starter package.
Under the Content Section, I created a new content node called my related links. And on that node, I filled some link values...
Within my Content Page Template I have the following code....
But this code generates the following error when the web page is loaded...
I'm not sure what I am doing wrong in the process. Any ideas?
Many thanks!
Hi Blackhawk
Try to use Related Links datatype instead of Multy Url Picker. Look how to use it - https://our.umbraco.org/documentation/getting-started/backoffice/property-editors/built-in-property-editors/Related-Links2
Thanks,
Alex
I did earlier, and love it. The only thing that Related Links is lacking is the ability to link to documents stored in the Media section. I'm going to have editors wanting to link multiple documents onto any given content node. This is the "only" reason why I am messing with the Multi URL Picker.
Hi, yes, I can understand you, I'm not the fan of RelatedLinks also, but it supported by the core
Tyy to get links value as string and the cast it to "MultiUrls" manually
Thanks,
Alex
Hi blackhawk,
What does
Model.Content.GetPropertyValue("links")
return?It depends on the version that you're using but that might be coming back as an `IEnumerable'.
So, see what the above returns but you may also want to try
Model.Content.GetPropertyValue<IEnumerable<Link>>("links")
instead.You'll also want to change your if statement to:
Hope that helps!
Using
Model.Content.GetPropertyValue<IEnumerable<Link>>("links");
saved the day!And I also learned the benefit of using
@ObjectInfo
to print out values. So using...@ObjectInfo.Print(multiUrlPicker)
....which is now displaying the correct values!
Thank you Ben!
Hey Blackhawk,
I had the same error. Make sure on the datatype you have either single or multi set.
Single Link
MultiLink
Thank you! This works, and thanks for the extra info on a single link.
is working on a reply...