This documentation site is about the unstable (upcoming) Comentario version.  Switch to the stable version »

Attribute: domain-id

The domain-id attribute of the <comentario-comments> tag allows to specify a domain to load comments for

The domain-id attribute of the comments tag can be used to explicitly provide ID of a domain to display embedded comments for.

In order to display comments, Comentario needs to figure out at least the following two things:

  • Domain hosting the comments.
  • Domain page the comments are on.

Domain

By default, the embedded comentario.js script sends the host component of the current page URL to the Comentario server, which uses it to look up the corresponding domain object and the related configuration.

In certain situations, however, this doesn’t work. One example is opening a local HTML file, with a URL like file:///home/user/path/to/page.html — there’s simply no host value at all. In this case, you’ll need to explicitly provide a domain ID, a unique identifier of your domain, which looks like 3777806a-b030-465e-a01c-84404e1c0126 and can be found on the Domain properties page.

When provided, it takes precedence over the URL host value mentioned above.

When overriding the domain, you’ll also need to allow loading comments from the current origin using the Allowed origins for embedded Comentario dynamic configuration parameter.

For example, for the file: URL above you’ll have to add null as an allowed origin.

Domain page

The domain page to serve comments for is by default determined by the path component of the current URL. Needless to say, the page must belong to the domain described above.

The page path can also be overridden: see the page-id attribute for more details.

See also