
Shahariar Fahim (Customer) asked a question.
I'm working with Sitefinity CMS and trying to understand how to correctly define a Choices field in the
ViewMetaData.json
file for a dynamic module.
{
"fieldTitle": "InputVoltage",
"fieldType": "Choices"
}
But getting an error
"No field Match available. Choose another template."
Can anyone help me?? What to do??
This is a radio button.
Is there anyone who can help me out of this??
Hi @Shahariar Fahim (Customer)​ ,
The Choices field type is not yet supported for the field mappings.
But you can still show the value of the choice field on the frontend in the view. The field mapping just let's you reuse the widget template for other content types and dynamically select from the widget edit view which content type properties for which mapped fields to use.
Check this Sitefinity KB article for a sample on how to show a content item choice field value on the frontend: https://community.progress.com/s/article/renderer-display-choice-field-on-frontend
Another option would be to sample from the Sitefinity github sample project:
https://github.com/Sitefinity/sitefinity-aspnetcore-mvc-samples/blob/e4d38881c0270ca249244978c1b880bfe6701593/src/all-fields/Views/Shared/Fields/Choices.cshtml
Here is what I tried:
In the backend I create my content item and select the choice
And On the frontend I see the selected value:
And this is the type of the field in the module builder:
You can choose what works best for you.
Regards,
Sabrie