Commentix Plugin
Commentix is a hosted commenting service for websites that need threaded discussions, moderation controls, and a compact embed. The Commentix plugin adds its comment widget to selected posts and pages on your Publii site.
You need a Commentix account, an active subscription or trial, and the Site ID assigned to your registered website. The plugin uses the Commentix Web Component and gives each Publii post or page a stable thread identifier, helping comments remain connected when you change a page slug.
Adding Comment Plugin Support to Older or Custom Themes
Current Publii themes include support for comment plugins. Follow this section only if you use an older theme or a custom theme that does not include the commentsCustomCode helper.
- Open your file manager and go to
Documents/Publii/sites/YOUR_SITE/input/themes/YOUR_THEME. ReplaceYOUR_SITEwith your site's folder name andYOUR_THEMEwith the active theme's folder name. - Open the theme's
post.hbsfile in a code editor. If the theme has other post templates, update those files as well. Near the end of the file, find the old comments block. It may look like this:
{{#if @config.post.displayComments}} <div class="post__comments"> <div class="wrapper"> <h2 class="h5">{{ translate 'post.comments' }}</h2> {{> disqus}} </div> </div> {{/if}}Replace it with:
{{#if @config.post.displayComments}} <div class="post__comments"> <div class="wrapper"> {{{@commentsCustomCode}}} </div> </div> {{/if}}- Save the file.
Keep a backup of custom theme changes. A theme update can replace edited theme files.
Activating the Plugin
- Open Tools & Plugins in Publii.
- Find Commentix and enable its switch.
- Click the plugin card to open its options.
- Enter your Site ID, review the remaining settings, and save the changes.
- Regenerate the website after changing the plugin configuration.
Creating a Commentix Site and Finding Its Site ID
The Site ID connects the widget with the website, comments, and moderation settings stored in your Commentix account.
- Create an account through the Commentix registration page, or sign in to an existing account.
- Open the Commentix Console and select Add Site.
- Register your website and open its Integration section.
- Copy the Site ID shown in the installation code. It resembles
ebf94680-ea4a-43f2-a831-933afd61310c. - Paste the identifier into the plugin's Site ID field. Copy the ID only, without quotation marks or the surrounding embed code.
Publii creates the Commentix element and script, so you do not need to paste the service's installation snippet into your theme.
Plan information: Commentix provides a 14-day trial. Paid subscriptions use the combined number of widget pageviews across the sites connected to your account. Check the current Commentix pricing and limits before publishing.
Enabling Comments in Your Theme
The plugin supplies the comment widget, while the theme decides where Publii can display it.
To enable comments for posts or pages across the site, open Theme and go to Custom Settings → Post Options or Page Options. Enable Display Comments.
You can also control comments for one post or page. Open the item in the editor, click the settings icon, choose Other Options, and change Display Comments.
Commentix Plugin Options
The plugin settings control the Commentix connection, thread layout, initial comment order, appearance, loading behavior, and optional Cookie Banner integration.
Required: Enter a valid Site ID before publishing. Commentix cannot load the widget without it.
Comments Configuration
- Site ID – The identifier shown in the Integration section of your website in the Commentix Console.
- Comments language – Sets the language of buttons and interface messages. Choose Use page language to let Commentix read the
langattribute from the page, or select a language in Publii. Commentix uses English if the page contains no supported language. - Default comment order – Sets the order shown when the widget opens. Choose Best first, Newest first, or Oldest first.
- Maximum reply depth – Sets how many nested reply levels readers can create. The Reply button disappears after a discussion reaches this depth. Enter a whole number from 1 to 20. The default value is 3.
- Initially visible comments – Sets how many top-level comments appear before Commentix shows its button for loading the remaining comments. Enter a whole number from 1 to 100. The default value is 5.
- Initially expanded reply levels – Sets how many reply levels remain open when the widget loads. Enter a whole number from 1 to 20. The default value is 1.
- Show comment count – Displays the total number of comments in the widget header. Disable the option to hide the count.
- Enable comment likes – Lets readers like comments and displays existing rating controls. Disable the option to hide these controls.
Appearance
- Comments heading – Text shown above the comment widget. Leave the field empty to hide the heading.
- Heading level – The HTML heading level used for the title. H2 suits most themes, but you can choose H3 through H6 to match the page structure.
- Accent color – Sets the Commentix brand color used for buttons, links, and other controls. Choose a valid three-digit or six-digit hexadecimal color.
- Base interface size – Scales the widget's type, spacing, and controls from one value. Enter a whole number from 10 to 32 pixels. Commentix uses 16 pixels by default.
Messages
- JavaScript disabled message – Text shown when a visitor has disabled JavaScript in the browser.
Advanced Styling
These fields change the Publii elements around the widget. Keep their default values unless your theme requires other CSS classes.
- Outer container CSS class – Sets the class on the outer element surrounding the comment section. The default value is comments.
- Inner container CSS class – Sets the class on the inner comment container. The default value is comments-wrapper.
- Heading CSS class – Adds a CSS class to the comments heading. Leave the field empty to use the theme's standard heading style.
Commentix embeds the widget without an iframe, so your theme can also override the CSS variables listed in the Commentix design customization guide.
Loading
- Load comments when visible – Delays the Commentix script until the visitor scrolls near the comment section. Disable the option if you want the widget to start loading with the page.
Cookie Banner Integration
- Require consent before loading – Prevents the browser from downloading the Commentix script until the visitor accepts the selected Publii Cookie Group.
- Cookie Group ID – The internal Group ID configured in Site Settings → Privacy Settings → Cookie Groups. Enter the same value in both places, for example comments.
- Message before consent – Text shown where the comment widget would appear until the visitor accepts the selected Cookie Group.
Configuring Cookie Consent
Commentix states that its platform uses necessary functional cookies and no cookies for analytics, tracking, or marketing. Your privacy policy and legal requirements determine whether you need consent before loading the external service.
Follow these steps if you enable Require consent before loading in the plugin:
- Open Site Settings → Privacy Settings.
- Enable the Cookie Banner and its advanced cookie configuration.
- Add Commentix to a suitable group, such as a functionality or comments group.
- Give that group a Group ID, for example
comments. Use letters, numbers, hyphens, or underscores without spaces. - Return to the Commentix plugin and enter the exact same value in Cookie Group ID.
- Save the settings and regenerate the website.
Do not leave Cookie Group ID empty while consent integration remains enabled. The plugin will keep Commentix blocked because it cannot determine which consent should unlock the script.
Read Publii's Cookie Banner guide for details about external scripts and Cookie Groups.
Thread Identity and URL Changes
Commentix groups comments into threads. Without a custom thread value, the widget derives its identifier from the page path. A changed slug can then open a new, empty discussion.
The plugin assigns a stable value from the Publii content ID, such as post-54 or page-63. Keep the same Publii content ID and Commentix Site ID to preserve the connection with its discussion.
A custom Commentix integration that used another thread value can create a separate discussion. Export or migrate the existing comments when you need to change the identifier.
Absolute and Relative Publii URLs
Commentix accepts a full http:// or https:// address in its page setting. It rejects relative values such as ../../blog/article/ with the message Loading config failed: Invalid URL.
The plugin checks Publii's URL mode during rendering. For absolute URLs, it sends the full public page address. For relative URLs, it omits the page setting and lets Commentix derive the final address from the visitor's browser. Commentix removes query parameters and fragments from that browser address. The stable thread ID remains unchanged in both modes.
Language Settings
Select Use page language when the widget should follow the language configured for your Publii site. Commentix reads the page's lang attribute and falls back to English when it does not recognize the value.
Select a specific language in the plugin when you want to override the page language. Commentix supports Czech, Danish, German, Greek, English, Spanish, Latin American Spanish, Finnish, French, Hungarian, Italian, Dutch, Norwegian, Polish, Portuguese, Brazilian Portuguese, Romanian, Russian, Swedish, Turkish, and Ukrainian.
Privacy Disclosure
The Commentix widget does not show links to the service's Terms and Conditions or Privacy Policy. Commentix instructs site owners to disclose third-party data processing when applicable to their jurisdiction.
Review the Commentix Privacy Policy and add the required information to your own privacy notice. Commentix operates from Switzerland and lists the providers involved in hosting, CDN delivery, email, and payments in that policy.
Preview Mode
The plugin does not load the live Commentix widget in Publii Preview. It displays a status message in its place. Generate or synchronize the site and open the page from a staging or public URL to test comments, language, appearance, and the Cookie Banner flow.
Troubleshooting
- No comment section appears – Confirm that the plugin is enabled, the Site ID is present, and Display Comments is enabled for the current content type or item.
- Commentix reports “Loading config failed: Invalid URL” – Regenerate the site with the current plugin version. If you added a custom Commentix embed, remove its relative page value or replace it with a full public URL.
- The Site ID is rejected – Copy the identifier from the website's Integration section without quotation marks, spaces, or the surrounding HTML code.
- The selected number option has no effect – Enter a whole number within the range listed for that option. The plugin replaces missing or invalid values with the Commentix default.
- The accent color has no effect – Choose a valid three-digit or six-digit hexadecimal color.
- The interface uses the wrong language – Select a language in the plugin or check the
langattribute generated from the Publii site language. - The consent message remains visible – Confirm that the Cookie Group ID in the plugin matches the Group ID in Privacy Settings, including capitalization.
- Comments do not appear in Publii Preview – Test the generated site from a public or staging URL. The plugin skips the external Commentix request in preview mode.
- A page shows a new empty discussion – Check whether the Publii post or page ID changed, or whether an older custom integration used another Commentix thread value.
- Comment sections close after reaching the plan limit – Check widget pageviews in your Commentix account. Commentix states that sections reopen at the next billing period or after an account upgrade.
For current service behavior, see the official Commentix guides to integration, widget configuration, moderation, and data import and export.