Copied to clipboard

Flag this post as spam?

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


  • Jørgen Bakke Eriksen 44 posts 95 karma points
    May 06, 2015 @ 15:19
    Jørgen Bakke Eriksen
    0

    Best practice getting JSON for Property Editors saving content as Id (MNTP, Content and Media Picker - U7.2.4)

    Hi guys!

    We are building i site for a customer and for the first time using JSON/AngularJS for frontend. We have used the Tapas plugin to deliver JSON data for a proof-of-concept category page which is listing all items in a content folder and an element page displaying data about specific content element.

    The content of A has among others to properties:

    1. a multi mode tree Picker (MNTP) which allows the editor to link the document to a number of reusable documents of type B
    2. a media picker (MP) which allows the editor to select an image to be shown on the category and element page
    Now, using the Tapas plugin we quickly have faced the challenge of getting information about the items linked through the MNTP and MP. Both property editors save the links as node-/mediaIds on the CMSPropertyData table in the db and the JSON delivered of course just prints the id of the related content.
    For now we have created two Angular scopes, one containing the A-documents and one containing the B-documents. And in order to get necessary information about the linked B-documents when listing information about for the A-documents, we do lookups in angular.
    I have a feeling that we could see performance gains by doing this some other place, by making sure that the JSON-data for the A-documents included necessary information about the B-documents.
    The story for images is the same: the A-document information include an id to the media-item, not the URL.
    We are considering three options (last applies only to images):
    1. Writing our own custom JSON
    2. Modifying Tapas
    3. get images async with f.ex Node2Json
    I see that Node2Json has been tried for this purpose before but there doesn't seem to be a solution according to this discussion.
    So our option seems to be 1 or 2. We would appreciate any feedback or pointers regarding what to investigate further or if anyone has had the same issues and found a best practice for this.

Please Sign in or register to post replies

Write your reply to:

Draft