Replies: 7 comments 21 replies
-
As a property-editor? Contentment does have a couple of read-only "editors" - "readonly-node-preview.html" is used on Content Blocks to show the selected ElementType. Notes is potentially reusable? or maybe Render Macro? I did prototype a read-only editor using |
Beta Was this translation helpful? Give feedback.
-
Yes, exactly 👌
|
Beta Was this translation helpful? Give feedback.
-
Okay, so a "Templated Label"? Actually, Notes isn't too far away from this, as the view can render AngularJS templates, (via my own |
Beta Was this translation helpful? Give feedback.
-
@bjarnef I've did a quick prototype. Swapped out one of my properties that had some Content Blocks data in there. Turns out that I was able to reuse my Notes editor-view. I only had to use 3 classes... and one of those is the ValueConverter, which is only there for playing nice with ModelsBuilder support. I've put them in a Gist, if you wanted to play with it? https://gist.github.com/leekelleher/cfa4f3585ea0616241f22b3508f06e99 I'm not 100% sold on the idea of included this as default with Contentment yet. It's one of those where I'd want to play with it more, incubate the idea, etc. (I'm funny that way) 😆 |
Beta Was this translation helpful? Give feedback.
-
You know, I think I'd like something similar to this as well. The main use-case is that I frequently have a need to pull in some external data from an API call or whatever and store it with the node data. Sometimes this is done with an event ("OnSave"), and sometimes the data is being updated by an external operation - like a daily import or something. What I have found is that if I use a "Label" with the "Long string" value type, I can't access the stored data (it always comes across as "NULL" in models, etc.), so I tend to use the "Textarea" - which works. The challenge is that it is visible - and editable - to the Editors, and I don't want them to edit the Serialized JSON. (With the possible exception of a "Clear" button, so the OnSave event could regenerate it.) I don't personally need a fancy templated display. I think your formatted JSON example is plenty readable. 😊 My "dream" PropertyEditor would allow some config, perhaps like this: One thing I have been working on is a better way to manage external videos (YouTube, Vimeo, etc.), via a "Video" media type, which can then be "picked" on Content nodes, etc. I came across Dave's "OEmbed-Picker-Property-Editor", which makes the RTE "Embed" tool available as a stand-alone property. Looking into the OEmbed data which is available from these services, I realized that I wanted to have more than just the embed HTML available to me, so I wrote an event which duplicates some of the "Embed" tool functionality to do it's own call to the oembed api endpoint and pull back the full set of available data, which then gets processed a bit into a custom object model, and stored in as serialized JSON on the Video media node - right now in a Textarea: It would be awesome if I could "protect" this data - and even display it to the Content Editor in a nicer format, since they can see it anyway... |
Beta Was this translation helpful? Give feedback.
-
Good news... I've opened PR #133! 🎉 I need to complete the documentation before merging it in. (Or if anyone wants to help, it's open to any help) 😄 Interesting part in this Template Label editor is the "Developer mode" toggle (which I built for some of the other Contentment editors), meaning that you can make edits to the underlying data once it is in there. |
Beta Was this translation helpful? Give feedback.
-
...and it's been released in Contentment v2.2.0! 🌟 |
Beta Was this translation helpful? Give feedback.
-
Is your feature request related to a problem? Please describe.
Sometimes you want to store reference to external data in a property editor, e.g. using Label in core and properties "External Id" and "External Name". You could also store the raw JSON in Label (string), but doesn't look nice.
Describe the solution you'd like
It could be useful to store an entity/object as JSON in a readonly/label editor and maybe a custom view/template to present to data, e.g.
Beta Was this translation helpful? Give feedback.
All reactions