1

I need to add form settings to my custom display format, can you provide me with an example?

To be clear I just want to add some fields to the format settings form.

format settings form

  • What settings are you talking about? Can you provide a screenshot? – No Sssweat Mar 13 '16 at 16:55
  • thanks for answer, I already added a image to the question. – Maicol Lopez Mora Mar 13 '16 at 17:16
3

Whenever you need to figure out how something works, look at examples that already do what you want. In your case, that's the ImageFormatter plugin.

Specifically, you are looking for the methods defaultSettings(), settingsForm() and settingsSummary(). Implement them, define the form for you settings, specificy default settings and for improved user experience, implement the summary method to give users a short summary of the current settings.

That's all, in viewElements(); you can then access your settings with getSetting().

  • Thanks!!! its work! before your answer I was checking that, but I was having doubt. – Maicol Lopez Mora Mar 14 '16 at 3:39

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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