Unsure how to map description field for Content lists #419
-
Is there a supported way to map the description or image field when you're using the built-in Umbraco Content data source? The code makes it look like the description is blank if you're targetting non-templated content. Do I need to create a custom data source to do it, or is there a way to map it to fields of the content record? |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment
-
@ChristopherBass That's correct, for the Umbraco Content data-source, the assumption is that if a document doesn't have a template assigned to it, then it's not routable, so doesn't have a URL to display. In the initial development used the GUID as a fallback, but I got feedback saying that it looked ugly, so changed it to being an empty description. I do like the idea of being able to map the Data List item's name, value, description with specific properties. It'd make it quite powerful. But it would also open up much more work for me, to figure out how to stringify complex values, (and there'll always be someone who wants to pull out a deeply nested value out of a Block List within a Block Grid or something; it hurts my head thinking about it). At that point, it's simpler all round to recommend rolling your own custom data-source. |
Beta Was this translation helpful? Give feedback.
@ChristopherBass That's correct, for the Umbraco Content data-source, the assumption is that if a document doesn't have a template assigned to it, then it's not routable, so doesn't have a URL to display. In the initial development used the GUID as a fallback, but I got feedback saying that it looked ugly, so changed it to being an empty description.
I do like the idea of being able to map the Data List item's name, value, description with specific properties. It'd make it quite powerful. But it would also open up much more work for me, to figure out how to stringify complex values, (and there'll always be someone who wants to pull out a deeply nested value out of a Block List within a Bl…