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've created a custom property (addressFinder), with a valueType "JSON", and 3 properties in the JSON object (addressLatitude, addressLongitude, and locationAddress). Here's the package.manifest:
I'm using the data type in a document type called 'Office Location' where I'm wanting admin users to enter map locations that I'm going to use for a single Google map on another page.
I'm trying to render out an array of the location data from addressFinder on another page (a document type called 'Map'), and was just wondering how I access the stored JSON data? I'm actually using a partial view macro file within a page, but I'm assuming it's the same syntax.
I tried both of the following to no avail (just to see if I could get a value printed out):
Is anyone able to point me in the right direction in terms of accessing the fields within my JSON object?
You'll probably want to implement a custom property convertor.
This would handle deserializing the JSON into an object that you can use in your partial view (and anywhere else on the site that might use the same data type).
There is a good example of how to do that in the following forum post : https://our.umbraco.com/forum/umbraco-7/developing-umbraco-7-packages/61760-A-question-about-property-converters#comment-210057
Hope that helps!
is working on a reply...
Write your reply to:
Image will be uploaded when post is submitted