Search code examples
content-management-systemorchardcmsorchardcms-1.8orchard-modules

Add class to radio button in choice list field, orchard cms


I am using orchard cms 1.8.1 and installed a module - Choice List Field - 1.0.0. Every thing is working fine. But how can i add a class to radio button. For example i am having two radio buttons like: Male and Female, i need to add classes like: rdoMale to Male radio button and rdoFemale to Female radio button how can i achieve this. Note: In Content type, input field has "Editor css class".

enter image description here

But for choice list field there is no option to add a class. enter image description here

Please Advise


Solution

  • You have to make an alternate view of the Editor of the field : Modules\Orchard.Fields\Views\EditorTemplates\Fields\Enumeration.Edit.cshtml

    Copy it with in your theme in the folder EditorTemplates\Fields\Enumeration.Edit.cshtml and change the code to add the css style you want.