Skip to main content
Skip table of contents

elements

Rule

elements

Description

Control which elements can be used on a page, for example to prevent certain heading levels.

This rule can also be used to control macro usage, like the macros rule, but offers greater flexibility to control other non-macro elements.

Ignore pages with label

scq-ignore-elements

Configuration options:

allowed

List of element names that are allowed to be used exclusively.

Every element not in this list will be reported in the quality report.

The value of this property can either be a plain string that specifies the element name or can be an element + parameters that should be allowed (see examples below).

blocked

List of element names that are not allowed to be used.

Every element in this list will be reported in the quality report. If an element is listed on both the allowed and blocked list it will be blocked.

The value of this property can either be a plain string that specifies the element name or can be an element + parameters that should be blocked (see examples below).

Block tables from being used on the page

YAML
rules:
  - rule: elements
    level: major
    blocked: tables

Allow only paragraphs and headings to be used on the page

YAML
# this will report usage of any other supported editor element
# such as lists, quotes, tables, emojis, layouts ...

rules:
  - rule: elements
    level: major
    allowed: # multiple elements blocked by name
      - paragraph
      - heading1
      - heading2
      - heading3
      - heading 4
      - heading5
      - heading6

Block only 3-column layouts from being used on the page

YAML
rules:
  - rule: elements
    level: major
    blocked: 
      - element: layout
        parameters:
          type:
            - three_equal
            - three_with_sidebars

Allow all elements, but for layouts only allow 3-column layouts to be used on the page

YAML
rules:
  - rule: elements
    level: major
    allowed: 
      - '*'
      - element: layout
        parameters:
          type:
            - three_equal
            - three_with_sidebars

Block hyperlinks to specific domains

YAML
rules:
  - rule: elements
    level: major
    blocked: 
      - element: link
        href:
          - startsWith: http://
          - contains: google.de
          - endsWith: .de

The above example specifies three different patterns that would report all links that either start with “http://”, contain the text “google.de” or end with the text “.de”.

Check macro usage

YAML
# "Code snippet" macros will be reported as major issues

rules:
  - rule: elements
    level: major
    blocked: [code]

The elements rule can also check macros by name and parameter, just like the macros rule. The difference is that the elements rule can also check other things that are not macros, such as headings.

JavaScript errors detected

Please note, these errors can depend on your browser setup.

If this problem persists, please contact our support.