Special Web Tags

Overview Special CG Tags

When CG API runs on your website you can add HTML elements with the "cg" attribute in order to create CG element tags. CG element tags can be used to operate various VG actions from different sections on your website. For example:

  • Open CG settings menu
  • Open widgets selector
  • Create widget on click

CG application that wants to utilize the special tags should call: CGApplication::prepareCGTags() function.Currently tags are supported natively by these apps: CG-Button, CG-Ecommerce-Button, CG-Headless Web client.

Note that in the case of "button" CG tag, you are responsible for styling the cg tag element. CG Only detect those tags according to the "cg" attribute, and register an action on these elements. It also means that you can use an element type based on your need. This may be a button, a span, a div, or other. The importance when considering CG button tag is the "cg" attribute that define the type of event to be registered for corresponding element. Other styling and COM aspects are in your control.


Button Tags

Open CG Setting

<button cg='{"type":"button", "label":"Content Glass", "action":"open-settings"}' >Open settings</button>


Open widgets selector

<button cg='{"type":"button", "label":"Content Glass", "action":"open-widgets-selector"}'>Open Widget Selector</button>


Create Widget

<button cg='{"type":"button", "label":"Content Glass", "action":"create-widget", "lib":"rhz-basic", "widget_type":"cg-PictureBox", "widget_options": {}}' title="Create Widget lib=rhz-basic, widget_type=cg-PictureBox">Create Widget</button>


Self Embedded widgets

This feature is currently under development and will be launched soon. The feature will make it possible to ember HTML elements that automatically populate with specific widget that may also be assigned with specific scope layer, peers and/or groups.

Note that this is not the same as the "appendTo" option of CGWidget that makes a widget created manually or programmatically, append to specific HTML element instead of being floating.   

Using the embedded widgets tags you will be able to create ro shape website themes that include CG widget natively as part of its views. In other words, this feature instruct CG engine to refer to specific DOM elements as widgets with all the referring to state oriented sharing logic. The view of the widget is the HTML content of the DOM but the presence of the dom element is controlled by CG state-oriented-sharing logic, based on the attributes set for the CG tag.