2

I am using Sitecore MVC form in rendering and the requirement is to make user capable of changing form back ground. Need suggestions to achieve it.

  1. Can we use rendering param in Sitecore form?
  2. Can we create a custom MVC form? I created but it seems to be not working.
  3. Or any other ways to achieve it ??

Version: Sitecore 9.2

1 Answer 1

0
  • create a new folder under /sitecore/system/Settings/Forms/Meta Data/CSS Class Options and call it Form

  • add new items for every color you want to use for the background colors under Form folder using /sitecore/templates/System/Forms/Meta Data/CSS Class Option template and for the value field use e.g. form-blue-background, 'form-grey-background`, etc.: enter image description here

  • select /sitecore/system/Settings/Forms/Field Types/Form item and in Css Class Autocomplete Options field select /sitecore/system/Settings/Forms/Meta Data/CSS Class Options/Form folder created earlier: enter image description here

  • now when your content authors start typing first name of the CSS class in CSS Class field of Styling section in Forms Editor, there will be auto-suggested option for all the available styles that you define:

enter image description here

Remember to add proper styling in your CSS files for all the background options.


EDIT

In Sitecore 9.2 there is no option for CSS Class Options metadata, but your content authors can still add any CSS class to the Styling section in Form Editor: enter image description here

There is no way to add auto-suggestion for the classes so you need to inform them about all the possible options for form backgrounds.

3
  • Thanks a lot @Marek for the detailed reply. However, the suggested items are not available in SC9.2. "/sitecore/system/Settings/Forms/Meta Data/CSS Class Options" "/sitecore/templates/System/Forms/Meta Data/CSS Class Option" In SC10, I can see items. How to do this in SC9.2 ? Commented Jan 29 at 5:27
  • 1
    @RashmiRanjan answer updated. In Sitecore 9.2 there is no option for CSS Class Options metadata, but your content authors can still add any CSS class to the Styling section in Form Editor. There is no way to add auto-suggestion for the classes so you need to inform them about all the possible options for form backgrounds.
    – Marek Musielak
    Commented Jan 29 at 6:15
  • Got it. Thanks @Marek. Commented Jan 29 at 7:23

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.