Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at

  • Victoria 10 posts 90 karma points
    Feb 11, 2019 @ 22:25

    Rendering custom properties in a template

    Hey there,

    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:

    enter image description here

    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):

    enter image description here enter image description here

    Is anyone able to point me in the right direction in terms of accessing the fields within my JSON object?

    Many thanks,


  • Chris Evans 92 posts 177 karma points c-trib
    Feb 12, 2019 @ 01:10
    Chris Evans

    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 :

    Hope that helps!

Please Sign in or register to post replies

Write your reply to: