Creating Components with HTML and CSS
Components for Setka Editor are made two ways:
In the Editor itself. To do this, build up the element and save it using the Component button in the right-hand panel. More on it in this article.
In the CDSM. It can be used to turn any HTML code into a component. This is useful if the standard features of the Editor are not enough. E.g. additional decoration or some specific structure is needed.
Any valid HTML code can be used as a component. The code also utilizes the standard Setka Editor elements: grids, columns, paragraphs, galleries, and images. They must contain the appropriate CSS classes. You can use your own classes in addition to the standard ones.
Follow the guidelines below to create valid components that will be accepted by the Editor.
A component can consist of the following elements:
Post
The main container of any Setka Editor publication.
HTML Structure
Usage example
Compatibility
The post cannot contain pure columns. Each column must be wrapped in a grid.
Paragraphs and headings
A paragraph is a basic content unit in Setka Editor. Any text should be placed inside a paragraph. Along with the paragraphs, there are also headings. Heading tags are: <h1>
– <h6>
.
HTML Structure
Replace stk-theme_XXXX__style_large_header
and stk-theme_XXXX__style_small_header
with header classes from your style.
Compatibility
A paragraph cannot be placed inside a grid. Before placing a paragraph into a grid, you need to divide this grid into columns or create one column for the entire width of this grid.
Usage example
Replace stk-theme_XXXX__style_large_header
with the header class from your style.
Grid
Layout Grid is used as a framework for a multi-column layout. Each grid consists of a container (stk-grid
) and column (stk-grid-col
). Images, paragraphs, and all other content types are placed within the columns.
HTML Structure
Compatibility
Usage example
Column
HTML Structure
You need to set the data-col-width
attribute for a column that determines its width. This attribute can be an integer from 1 to the maximum number of columns in a given grid. For example, in a 6-column grid, the data-col-width
attribute can take values from 1 to 6.
Compatibility
Usage example
Image
An image consists of:
An image container —
image-figure
.A mask —
mask
.The image itself —
<img>
.An image caption —
<figcaption>
.
All these elements are mandatory except for the caption.
HTML Structure
An image placeholder can also contain a link:
Compatibility
Image placeholder
Image placeholder — a place to insert an image into a post. When clicked, it opens the image selection menu on the right toolbar.
An image placeholder consists of:
An image container —
image-figure
.A mask —
mask
.An image caption —
<figcaption>
.
All these elements are mandatory except for the caption. The placeholder should not contain the image itself (the <img>
tag).
HTML Structure
Compatibility
Embed
An embed code structure is similar to an image and can contain any HTML code inside the <code>
element, including <style>
or <script>
.
HTML Structure
Compatibility
Divider
HTML Structure
Compatibility
Usage example
Replace tk-theme_XXXX__separator_basic_divider
with the divider class from your style.
Gallery
A gallery is a container for images. Gallery's JavaScript makes an animated slideshow in the preview mode and on the page where a post is published. The images are placed inside the gallery.
HTML Structure
Compatibility
Container
A container is a universal entity for any block type that can not be formed through the standard Setka Editor elements. Any class or attribute can be assigned for a container, ad for any other elements.
HTML Structure
Containers can also be used to form block links:
Compatibility
Deleting components
The component in an article is presented as static HTML code. In most cases, deleting a component from the style wouldn't affect the pages it was used on.
Components with custom CSS
Delete components with custom CSS carefully. Make sure other components and style elements do not rely on this component's CSS rules defined in the Custom CSS for component field.
If you need to delete the component that contains custom CSS, copy the content of the Custom CSS for component field and add it into your style's custom CSS.
Last updated