Newer Version Available
Create Custom Page Layout Components for Communities
- The Create New Page dialog box. To view the custom layout, select the Custom view in the Layouts tab.
- The Change Layout dialog box. To view the custom layout, select the Custom tab.
1. Add a New Interface to Your Layout Component
To appear in the Create New Page and Change Layout dialog boxes in Community Builder, a custom layout component must implement the forceCommunity:layout interface.
2. Add a CSS Resource to Your Component Bundle
Next, add a CSS resource to style the layout as needed.
Here’s the sample CSS for our simple two-column layout.
CSS resources must be named componentName.css. For example, the CSS resource for the component communityLayout.cmp is communityLayout.css.
3 Optional: Add an SVG Resource to Your Component Bundle
You can include an SVG resource in your component bundle to define a custom icon for the layout component when it appears in the Community Builder.
The recommended image size for a layout component in Community Builder is 155px by 120px. However, if the image has different dimensions, Community Builder scales the image to fit.
SVG resources must be named componentName.svg.