Copied to clipboard

Flag this post as spam?

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


  • Joe 32 posts 136 karma points
    Dec 13, 2020 @ 07:14
    Joe
    0

    Show custom data in backend content edit page

    Hi, I’m trying to show extra custom data field (a read-only text data for extra custom logging) for a content node on its Umbraco CMS content edit page. But I can’t find a post on similar challenge. Can anyone help?

    The old way previously applied are storing it as either “umbraco property of the target content”, OR “child umbraco content under the target”. However, now this extra audit text data need to be separated from umbraco content store due to some limitation.

    How can I show this data on the content edit page when this data is stored in other data table? I can make API to further retrieve the data, but no idea on proper way to extend the content edit page.

  • Marc Goodson 2149 posts 14355 karma points MVP 9x c-trib
    Dec 13, 2020 @ 10:46
    Marc Goodson
    100

    HI Joe

    In V8, 'Content Apps' have been created for just this purpose:

    https://our.umbraco.com/documentation/extending/Content-Apps/

    But in V7, you can mimic this by creating a custom property editor:

    https://our.umbraco.com/Documentation/Tutorials/Creating-a-Property-Editor/index-v7

    In the AngularJS controller, for your custom property editor you can get a reference to the current content item's id via

    editorState.current.id
    

    (if you inject editorState into your angularJS controller, and also consider to check for null, as new content items won't have a value here until the content item is saved)

    You can then use the id, to make a request to your apicontroller that returns the audit data from the custom table

    and choose how to display the information in the angularJS view of your custom property editor.

    As long as you don't set $scope.model.value - then nothing will be saved for your custom property editor, when the content item is save and published, your editor will just be a read only view of your audit data supplied by your api.

    regards

    Marc

  • Joe 32 posts 136 karma points
    Dec 13, 2020 @ 13:28
    Joe
    0

    Thanks Marc! That makes sense! Custom Property Editor can read contentId and display content preferred. Your answer also reminded me about nuPicker. Maybe such goal can be served by nuPicker's "DotNet Labels" in a quicker way. I'll give it a try first.

    Thank you very much!

Please Sign in or register to post replies

Write your reply to:

Draft