Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

DisplayTemplate "style" strategy in SaaS CMS Visual Builder

Vote:
 

Seems like it is required to have one display template set to default.

I can add two display templates to the same type, turns out like this:

Have you been creating multiple display templates like this or have you mainly had a single display template, with added settings to customize?

#335342
Jan 08, 2025 14:13
Vote:
 

Hi there! Styles consists of two entities, DisplayTemplates (display as) and DisplaySettings where the settings are scoped to the selected template. It's best to see templates as an abstraction for what could be a rendering component in your application and settings as the parameters that would apply to those rendering components. Consider the following setup for a section as an example:

  • Section
    • Default
      • Vertical spacing (small/normal/big)
    • Card
      • Background color (primary/secondary)
      • Highlight (true/false)
      • Vertical spacing (small/normal/big)

In the above example, two display templates (Default & Card) are assigned to the "section" base type with settings that apply to the respective template. In your example above I'm assuming the heading is rendered fairly similarly but you want to add (primary/secondary) style that the editor can choose between. If that is the case I would probably have defined it using a single template with a setting:

  • Heading
    • Default
      • Heading style (default/secondary)
#336258
Edited, Jan 31, 2025 8:43
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.