Skip to main content

Html Plugin

HTML plugin enables users to embed content in an iframe (either source code or by URL)

Add an Html

Usage#

/* Editor */
import { RicosEditor } from 'ricos-editor';
import { pluginHtml } from 'wix-rich-content-plugin-html';
<RicosEditor plugins={[pluginHtml(HtmlConfig)]} />;
/* Viewer */
import { RicosViewer } from 'ricos-viewer';
import { pluginHtml } from 'wix-rich-content-plugin-html/viewer';
<RicosViewer plugins={[pluginHtml(HtmlConfig)]} />;

Html Config API#

maxWidth#

The maximum component width in pixels. note: this value is dynamically limited by the editor boundaries

maxWidth?: number;

Default value:

940;

minWidth#

The minimum component width in pixels

minWidth?: number;

Default value:

35;

width#

The initial component width in pixels

width?: number;

Default value:

740;

minHeight#

The minimum component height in pixels

minHeight?: number;

Default value:

35;

maxHeight#

The maximum component height in pixels

maxHeight?: number;

Default value:

1200;

Adsense Plugin#

Adsense plugin is part of the html plugin. To use it we need to expose a button with exposeButtons and add the siteDomain:

Add adsense
/* Editor */
import { RicosEditor } from 'ricos-editor';
import { pluginHtml, htmlButtonsTypes } from 'wix-rich-content-plugin-html';
<RicosEditor plugins={[pluginHtml({ exposeButtons: [htmlButtonsTypes.adsense], , siteDomain: 'https://dana.wixsite.com/mysite' })]} />;
/* Viewer */
import { RicosViewer } from 'ricos-viewer';
import { pluginHtml } from 'wix-rich-content-plugin-html/viewer';
<RicosViewer plugins={[pluginHtml()]} />;

siteDomain Required#

Adsense will not work with out the siteDomain

siteDomain?: string;

exposeButtons Required#

The buttons exposed by the plugin

exposeButtons?: array;

Example value:

[htmlButtonsTypes.html, htmlButtonsTypes.adsense];