This feature is available on Beefree SDK paid plans only.
Overview
With Content Defaults, you can define how content looks when dragged into an email or page.
When adding new content elements through the Content tab, you may want a default style that matches one of these options:
your application’s color scheme;
your user’s branding guidelines;
the look & feel of the template used to create the message or page.
For example, here is how a button dragged into the stage looks by default:
The background color is always light blue (HEX code #3AAEE0).
The font size is always 16px.
The font is Arial, unless a different Default font was set for the template loaded in the editor.
The border radius is set at 4.
The CTA is a formally correct, but laconic “Button”.
Instead, when applying Content defaults, the button dragged by your users could look out of the box like this:
We’ve used a dark grey color (HEX code #555555), an Ubuntu font at 22px in Bold, with a border radius of 10 and a nice “READ MORE” call-to-action.
Content Defaults are part of the Configuration parameters passed to your Beefree application during startup, so you can have different sets of them for different users.
Use cases
By setting up your Content defaults, you’ll be able to address styling and branding needs for you and your customers.
Create a more consistent UX between your application and the editor
If your application uses dark grey for the primary CTA, then you probably would want a default button in the Beefree builders to follow that style.
Match your customers’ branding
If your application has brand settings that are used for your app’s UI or for assets managed in your application, you may want those to apply also to default content in the Beefree editors.
Create a more consistent experience within the editor
If you’ve customized how the editor looks like, either through Themes or Custom CSS, you may want default content to adhere to the same style.
Define custom social blocks
Since the Social block is one of the available Content defaults, you can define what social platforms – either present in the Beefree editors or added by you – are included when a social block is added to a message or page. For example, you can have a default social block with three platforms defined in the Beefree system and a fourth, custom one (Messenger):
How it works
To set up the content styles you will need to add the contentDefaults object to beeConfig:
You can add all the content styles, some of them or just one. It is up to your application to create them for all the users or for a segment, as there are no related server-side settings; basically you can customize them each time the editor starts.
All the contents use the same pattern, but the object must match the content schema for the type of content (described in the following section).
Title
The title content default inside the beeConfig sets default properties and styling for title elements in the editor. It includes heading levels, alignment, padding, and mobile-specific styles to ensure consistency and responsiveness across different devices.
The text content default within the beeConfig provides a default HTML string and sets the styles for text blocks, including color, font, and line height. It also includes options for padding and visibility on mobile devices to ensure a consistent appearance across different screen sizes.
Please note that the default text inside html is required.
text: { html:'This is default text for block...', styles: { color:"#e63c60", linkColor:"#e63c60", fontSize:'22px', lineHeight:"200%", fontFamily:"'Comic Sans MS', cursive, sans-serif", }, blockOptions: { paddingBottom:"20px", paddingLeft:"20px", paddingRight:"20px", paddingTop:"20px", hideContentOnMobile:true }, mobileStyles: { paddingTop:"30px", paddingRight:"30px", paddingBottom:"30px", paddingLeft:"30px", },}
Image
The image content defaults in the BeeConfig define the properties for images, including attributes like alt, src, and href, as well as styling details such as dimensions, border radius, and padding. It also specifies mobile-specific styles to ensure proper alignment and spacing on different devices.
The row content default in the BeeConfig specifies various styling properties for rows, including background colors, vertical alignment, border radius, and spacing. It also includes options for mobile-specific styles, such as stacking and padding configurations.
The following table lists the row content default parameters and their corresponding descriptions and data types.
Parameter
Data Type
Example
Description
backgroundColor
String
Red
Sets the background color of the row.
contentAreaBackgroundColor
String
Green
Sets the background color of the content area within the row.
verticalAlign
String
bottom
Specifies the vertical alignment of the row content.
columnsBorderRadius
String
10px
Defines the roundness of the column corners.
columnsSpacing
String
20px
Sets the spacing between columns.
columnsStackOnMobile
Boolean
false
Determines if columns should stack on mobile devices.
columnsReverseStackOnMobile
Boolean
true
Specifies if the order of stacked columns should be reversed on mobile devices.
columnsPadding
String
42px
Defines the padding inside each column.
columnsBackgroundColor
String
Yellow
Sets the background color for each column.
Button
The button content default in the BeeConfig specifies the appearance and behavior of buttons, including attributes such as label, hyperlink, width, and styles like font, color, and padding. It also defines block options for padding and alignment, as well as mobile-specific styles for responsiveness.
The divider content default in the BeeConfig specifies the appearance of dividers, including properties such as width, line style, and alignment. It also defines block options for padding and visibility on mobile, as well as mobile-specific styles for alignment and padding.
The social content default in the BeeConfig specifies the display of social media icons, including their type, name, image properties, and link. It also defines the block options for alignment and padding, with specific styles for mobile devices.
The dynamic content default in the BeeConfig specifies the block options, including padding and the ability to hide content on mobile. This ensures a consistent design by managing spacing and visibility across different devices.
The video content default in the BeeConfig specifies block options, including padding and the ability to hide content on mobile devices, ensuring a consistent appearance across different platforms. Additionally, it defines mobile-specific styles to enhance the user experience on smaller screens.
The form content default in the BeeConfig defines the structure and styling for form elements, including fonts, colors, alignments, and padding, ensuring a consistent layout across different devices. It also includes options for mobile-specific styles to improve usability on smaller screens.
The icons content default in the BeeConfig specifies the properties for displaying icon items, such as the image source, text, size, and link attributes. It also includes styles for the icon's appearance and mobile-specific configurations to ensure proper alignment and padding across devices.
The menu content default in the BeeConfig defines the properties for menu items, including text, links, and target attributes. It also sets the styles for the menu's appearance and behavior, such as font styles, colors, spacing, and mobile-specific configurations like hamburger icon settings.
The spacer content in the BeeConfig is used to add vertical spacing between elements in the layout. It allows for hiding the spacer on mobile devices through the hideContentOnMobile option.
The paragraph content configuration in BeeConfig specifies the default styles such as color, font size, alignment, line height, and spacing for paragraphs. It also defines block options and mobile styles to ensure consistent rendering on different devices.
The list content default in BeeConfig sets the basic styling for list elements, including options like color, font size, alignment, and list type. It also ensures consistent spacing and padding across devices by defining both block options and mobile-specific styles.
The carousel content default in BeeConfig sets the basic padding for carousel elements and provides an option to hide content on mobile devices. It also defines mobile-specific padding to ensure a consistent appearance across different screen sizes.
The table content default in BeeConfig specifies the initial styling and layout properties for table elements, including rows, cells, and headers. It sets text styles, colors, padding, alignment, and optional alternate row and header styles to ensure consistency across different table instances.
Note: If contentDefault values for the Table module are incorrectly formatted, the following onWarning will be triggered (this applies to incorrect values for rows and headers, not all contentDefaults), and the default table will be used instead:
{code:1730, message:'Content defaults for [Table] module are not valid'}
If the user tries to load a template that contains an improperly structured Table (for example, if a row does not contain all of its cells), the template will not load, and the onError will be triggered.
The following code displays an example error for this scenario:
{ code:2250, message:'Bump template validation error', detail:'page/rows/0/columns/0/modules/0/descriptor/table/rows: improperly structured field (each row must contain the same number of cells)',}
General
The general content default in the BeeConfig specifies the overall styling for the email template, such as background color, content area width, and default font. These settings help maintain a consistent look and feel throughout the template.