Create a Card

IntroductionIntroduction

In this guide, we will describe the principle of the card editor in order to easily create cards. The card editor offers plenty of blocks to insert in card in order to show off content from your posts, terms or users. All blocks are handled in the same ways and offer the same kind of settings.

The card editor is based on the WordPress editor. It is not the same editor as the one used on edit or site pages and will not offer the same blocks. It is a dedicated editor for cards based on the WordPress editor as a standalone.

Block InserterBlock Inserter

The block inserter allows you to insert blocks into the card layout. Blocks can be inserted by clicking on the desired block or by dragging and dropping it into the desired area of the card.

Block Inserter
Block Inserter

List ViewList View

The List View helps you navigate between layers of content and nested blocks. It’s currently visible in the Top Toolbar and will remain open as you navigate through your content.

List View
List View

Cards ListCards List

The Cards List allows you to switch between card editing at any time. It can also be used to easily preview cards or to copy blocks from one card and paste them into another card easily.

Cards List
Cards List

CardCard

On the main right panel of the card builder, under the Card tab, you will find several settings to adjust the main behavior and blocks of the card.

image
Card – Layout type

LayoutLayout

At first you need to set which type of card you want to build. You have 2 types of card : Masonry or Metro/Justified. A type of card correspond to a grid layout. Masonry cards only work with Masonry grids and Metro/Justified cards work with any type of grid.

The card accepts two different kinds of alignment when set to Masonry type. The card can have the media and content aligned either vertically or horizontally, depending on your needs.

OptionDescription
TypeType of layout used for the card
AligmentCard alignment (vertical or horizontal)
Switch to Vertical AtChanges the alignment to vertical at a browser width (horizontal card)

BlocksBlocks

A card is composed of main blocks which are the Header, Media, Body, and Footer. Depending on your needs, you will be able to hide/reveal these card blocks to build your own layout.

OptionDescription
Card HeaderDisplay the card header (content above the media)
Card MediaDisplay the card media (post thumbnail)
Card BodyDisplay the card body (content under the media)
Card FooterDisplay the card footer (content under the body)

ThumbnailThumbnail

If the Card Media block is enabled, you will be able to fine-tune the layout of the media/thumbnail displayed in the card.

OptionDescription
PositionPosition of the thumbnail in the card (horizontal aligment)
WidthWidth of the thumbnail (horizontal aligment)
OverlayAdd a layer on top of the media
Auto HeightAdjust the thumbnail height to fit the blocks added in the media content

BlockBlock

When clicking on any block of the card, you will be able to edit its settings in the main right panel of the editor. In this panel, you will find three main tabs:

  • Settings: To edit the block features, set up interactions, and conditions
  • Styles: To customize the appearance of the block
  • Animation: To reveal or hide the block on mouse hover

SettingsSettings

In this panel, you will be able to set up the main behavior of the block. And, you will find different settings depending on the selected block.

Card - Block settings
Card – Block settings

Most of the blocks also offer the following settings:

  • Interaction: To redirect on click or open/play a media (image, song, video)
  • Conditions: To render a block conditionally
  • Advanced: To add custom CSS class names and set up the HTML <element> of the block

StylesStyles

In this section, you will be able to fully customize the block appearance. The appearance can be set up conditionally depending on CSS selectors like :hover, :focus, :active. This allows you to change the look of the block when hovering over it or when it is focused, for example.

Card - Block styles
Card – Block styles

Moreover, these settings are responsive. It means that depending on a browser size (device) that you can select in the editor top toolbar, you will be able to set different styles for desktop, tablet, or mobile devices, for example.

AnimationsAnimations

Animations can be used to reveal or hide a block when the mouse hovers over it or over a parent block on the card. This can be very useful, for example, when you want to display a button only when the mouse hovers over the card.

Card - Block animations
Card – Block animations

These settings are also responsive and can be changed depending on the browser width, similar to block styles.

Dynamic DataDynamic Data

In several places of the card editor, you will be able to insert dynamic data. For example, you can insert data into buttons, paragraphs, custom HTML blocks. You can also use dynamic data in certain settings of the block like the URL, aria label, in conditions, etc. This makes things extremely flexible and powerful with endless possibilities.

Block - Dynamic data
Block – Dynamic data
image
Aria Label – Dynamic Data

ConditionsConditions

Because conditions are processed on the backend and impact the frontend, to ensure proper functionality, it’s recommended not to use a caching solution. Otherwise, you may cache certain conditions and render them incorrectly.

Blocks can be rendered conditionally. This means that if a block meets certain conditions, it will be rendered in the card.

Block – Conditions
Block – Conditions

Every condition consists of the following three properties:

  • Data (post ID, user role, date, dynamic data, etc.)
  • Compare with (==, !=, >, <, >=, <=, in, not in, contains, before, after, etc.)
  • Value (numeric, text, checkbox, option(s), etc.)

A condition can also include additional fields, for example, to select a facet to compare with a value.

Conditions accept both AND and OR logic to create advanced relationships between clauses. Within a set of conditions, an AND relation is applied, while between sets of conditions, an OR relation exists. This means that the block is rendered if at least one set of conditions is met.