Could Someone Give me Advice with Implementing Custom Fields in DatoCMS?

Hello there,

I am reaching out for some help with customizing fields in DatoCMS. I am working on a project where I need to create a complex content model involving several custom fields; but I am running into some issues with how to properly set them up.

I have a content model for a Product that needs to include fields such as a multi line text field for a product description; an image gallery; and a set of tags that users can select from. Additionally; I want to create a custom field where users can input a set of values that should be dynamically managed.

How can I implement a custom field that allows users to add and manage dynamic values; such as a list of product attributes? :thinking: I have seen some examples but am unsure how to integrate this into my model effectively.

What is the best way to configure an image gallery that allows multiple images to be added, and how can I ensure these images are properly displayed in the frontend? :thinking:

Also, I have gone through this post; https://community.datocms.com/t/plugin-fields-does-not-return-all-project-fields-power-bi/ which definitely helped me out a lot.

I want to implement a tags system where users can select multiple tags from a predefined list. What is the best approach for setting this up in DatoCMS? :thinking:

Thanks in advance for your help and assistance. :innocent:

Hi @samzyan425,

Welcome to DatoCMS, and I’ll try to address your questions one by one :slight_smile:

I think it depends on what the dynamic values are, and how they get populated. Can you give some examples? Probably it could be a multi-link field (or see video) to a “Product attributes” model, where each attribute is an individual unique record. But if you can give some examples, it would be better.

Inside Dato, that’s what our asset fields are for (specifically the Asset Gallery that allows multiple assets).

On your frontend, it depends on your framework. Normally you’d fetch the images for that field via GraphQL and then either map through them to display (each as one component) or pass them to some sort of slideshow/gallery component as an array. Can you provide more details?

Have you already seen our project starters, like the ecommerce starter in Next? The product pages give you an example of how to do a gallery (corresponding to this source code, for example).

You can make a JSON field, and in the presentation options, choose either multi-select:

Or you can use our Tag Editor plugin on that field for a more traditional tag experience: Tag editor - Plugins — DatoCMS


I hope some of that helps?

In general, have you already taken a look at our project starters? Project starters - Free demo projects - Marketplace? If you deploy one to your own account, you can better see how different content types tie into the frontend.

We also have a bunch of editor help videos here: How to DatoCMS — DatoCMS

Or dev documentation at: DatoCMS Documentation — DatoCMS

Of course, if you have any other questions, please also free free to ask here! Wherever you can provide specific examples (like what the actual things you’re trying to model are, how you want them to appear on the frontend, what frontend framework you’re using, etc.) that would all really help.

Thank you, and welcome again :slight_smile: