The Container
component is not a Variant
component, so you can't create variants for it.
You have 2 options, the best as has already been mentioned, just add a Style option for the Container
component and use that to add the background colors. It's the simplest and easiest to use option for content authors.
The 2nd is to clone an existing variant component, something like the Promo
, and create your rendering variants with a placeholder for the content. This will give you the ability to have multiple rendering variants, but you will end up with a very heavy handed component for something as simple as a Container
To add a placeholder to a Rendering Variant, you can either use the Variant Placeholder
item, if you are building the variant via the item model. Or, if you are using scriban templates, you can use {sc_placeholder "myPlaceholderKey"}
.
As to your question about the Datasource item and cloning the Page Content
component. For a component that is only there to act as a container, it is unlikely you would require a datasource item. However, the Page Content
component does not use a datasource item, it uses the current context item. So {i_item}
is your page item, and you would be able to render any fields on your page template.