List of key/value pairs for display on Umbraco pages
Hi. I'm wondering if there is a recommended or best practices way of storing a list of arbitrary key/value pairs in Umbraco. Using Razor code, I want to look up the values by key and display them on Umbraco pages.
Only my opinion but using nodes seems bad for doing this as you have all the overhead of a full content model for two fields. I would stick to using one of the packages like archetype or nested content. I'm sure it would also be pretty simple to create your own property editor look at this property editor as a guide .. you could pretty much use the prevalue editor in this to rework it as your editor.
List of key/value pairs for display on Umbraco pages
Hi. I'm wondering if there is a recommended or best practices way of storing a list of arbitrary key/value pairs in Umbraco. Using Razor code, I want to look up the values by key and display them on Umbraco pages.
I guess it depends on how much data you have. I'm assuming you want it to be editable, right?
So, for instance, you could just create nodes in Umbraco without a template - these all will have a unique Id and Name property.
You could also use something like Archetype package which allows you to create repeatable content - so create two fields (key and value).
Ok, thanks. It will be maybe 20 to 50 items. Sounds like using the node structure with a custom datatype/no template should work.
Only my opinion but using nodes seems bad for doing this as you have all the overhead of a full content model for two fields. I would stick to using one of the packages like archetype or nested content. I'm sure it would also be pretty simple to create your own property editor look at this property editor as a guide .. you could pretty much use the prevalue editor in this to rework it as your editor.
I decided knock up a quick property editor as i explained, you can see the source here
I also discovered this package though I preferred to build on the styling and behaviour of the dtp list example
That's cool. I'm not sure I know how or where to use it though. Will check out the guide you posted for using custom properties.
is working on a reply...