Skip to content

Configuration

The <commentix-widget> HTML element accepts various attributes to configure the widget. This page serves as the complete reference.

Info

Unless otherwise noted, all attributes are optional.

language

Specifies the UI language used by the widget.

By default, the widget reads the lang attribute from the document's <html> element:

<!doctype html>
<html lang="en">
...
</html>

If no language is detected or the value is not supported, the widget falls back to English (en).

Supported language codes:

  • cz (Czech)
  • da (Danish)
  • de (German)
  • el (Greek)
  • en (English)
  • es (Spanish)
  • es-419 (Spanish Latin America)
  • fi (Finnish)
  • fr (French)
  • hu (Hungarian)
  • it (Italian)
  • nl (Dutch)
  • no (Norwegian)
  • pl (Polish)
  • pt (Portuguese)
  • pt-BR (Portuguese Brasil)
  • ro (Romanian)
  • ru (Russian)
  • sv (Swedish)
  • tr (Turkish)
  • uk (Ukrainian)

Example

<commentix-widget site="{{ SITE_ID }}" language="de"></commentix-widget>

maxLevels

Controls the maximum allowed nesting depth for comment replies.

Once the configured depth is reached, the Reply button is hidden to prevent further nesting. Limiting nesting depth helps preserve readability and accessibility, especially on smaller screens.

Default: 3

Example

<commentix-widget site="{{ SITE_ID }}" maxLevels="2"></commentix-widget>

noCount

Disables the display of the total comment count in the widget header.

This attribute is boolean and does not require a value.

Example

<commentix-widget site="{{ SITE_ID }}" noCount></commentix-widget>

noRating

Disables comment rating (likes).

When set, users can no longer like comments and existing rating controls are hidden.

Example

<commentix-widget site="{{ SITE_ID }}" noRating></commentix-widget>

page

Defines the canonical page URL associated with the comment thread. This value is used to generate shareable links to individual comments and links to the thread in notification emails.

By default, the widget derives the URL from the current browser location, automatically removing query parameters and fragments.

For example, https://www.example.com/blog/article.html?id=value#some-anchor becomes https://www.example.com/blog/article.html.

If this behavior does not match your routing or canonicalization strategy, you can explicitly set the page URL using this attribute.

Example

<commentix-widget site="{{ SITE_ID }}" page="https://www.example.com/blog/article.html?id=123"></commentix-widget>

site

Identifies the site this widget instance belongs to.

This attribute is required. You can find your site ID in the Integration section in the Commentix Console. Use the same ID across all pages that belong to that site.

Example

<commentix-widget site="ebf94680-ea4a-43f2-a831-933afd61310c"></commentix-widget>

sort

Sets the initial sort order of comments.

Supported values:

  • best
  • latest
  • oldest

Default: best

Example

<commentix-widget site="{{ SITE_ID }}" sort="latest"></commentix-widget>

thread

Explicitly defines the identifier used to group comments into a thread.

All comments on a site are grouped in threads, and each thread belongs to a single page. By default, the widget uses the pathname of the current browser location as the unique identifier of the thread. For example, if the widget is embedded on https://www.example.com/en/blog/some-article.html?param=value, the thread ID will be /en/blog/some-article.html.

While sufficient for many sites, this default can cause issues in the following scenarios:

  1. URLs change over time (e.g. content migrations or rewrites)
  2. Multilingual sites where language is not part of the pathname
  3. Pages identified by query parameters or backend IDs (e.g. /blog/article?id=123)
  4. Multiple URLs pointing to the same logical page

In these cases, setting a stable, application-defined thread ID is strongly recommended.

Example

<commentix-widget site="{{ SITE_ID }}" thread="article-123-en"></commentix-widget>

visibleComments

Controls how many root comments are shown initially before the Show all comments button is displayed.

Default: 5

Example

<commentix-widget site="{{ SITE_ID }}" visibleComments="10"></commentix-widget>

visibleLevels

Controls how many comment levels are expanded by default.

Default: 1

Example

<commentix-widget site="{{ SITE_ID }}" visibleLevels="2"></commentix-widget>