0

Goal

I'm looking to build a mechanism to allow system administrators to easily configure various components of a Visualforce page that is used in a site (without having to modify code). I would like to enable them to configure the:

  • Button labels
  • Text that will appear on the page (rich text)
  • Banner and logo images
  • Field set that will appear on the page
  • Page background color (in hex format)
  • Hyperlink URL for a button

It seems to me that either a custom metadata type, or a Visualforce tab, or a Lightning App Page + LWC would be best for this purpose.

Question

  1. What would be the best way to enable admins to easily configure various components of a Visualforce page (such as the ones listed above) without having to modify its code?

  2. Is it possible to restrict the number of records that can be created for a custom metadata type to one? There is no need for more than one metadata record in this case.

  3. There is no Rich Text field type for custom metadata. How then could I give admins the ability to specify rich text for the Visualforce page if I use a custom metadata type?

  4. Would building a Visualforce tab or a Lightning app page + a LWC for this purpose require significantly more effort than simply setting up a custom metadata type?

Thanks

1
  • this reminds me of the config page for designing a Quote in CPQ (they used a custom object in lieu of custom metadata)
    – cropredy
    Oct 13, 2019 at 5:08

1 Answer 1

0

So, if you're talking about admin-specified rich text, and the admins are trusted (that is, you're not worried about an admin injecting malicious markup; I'd warn, say, an ISV against using this because they don't know what various customer admins might do), you could allow them to enter markup directly in a long text area in the custom metadata record and render it with escape="false".

Doesn't give you RTA input features, but it does allow for formatting.

1
  • Thanks Avrom, that's a good suggestion. We ended up going with Custom Metadata without allowing markup due to security considerations.
    – M H
    Oct 16, 2019 at 21:43

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .