Soda Extended HTML
Soda Extended HTML

Extended HTML

Page templates, and blocks placed on pages, are written in HTML, with extensions that are described below. 

Agent HTML

The extension construct

<agent url="requesturl" id="divid" class="divclass" />

inserts a <div> construct containing HTML returned by an agent. The returned HTML should be an HTML fragment, rather than a complete page.

  • requesturl is the URL from which the remote HTML is retrieved. It MUST be the URL of an action of an agent that is registered with an access level. The user's access level MUST be superior to the agent's access level. If the Soda installation serving the page is running under Kubernetes in the same cluster as the service that is the agent that returns the HTML fragment, the request URL should be of the form http://agentname/.svc.cluster.local/action )
  • divid is optional. If supplied, it will be the id of the inserted <div>
  • divclass is optional. If supplied, it will be the class of the inserted <div>.

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

Blocks

The extension construct

<blocks id="blocks id"  class="block class" />

inserts a div containing blocks into the page. The div has sodablocksid attribute with value blocks id, and class block class. The sodablocksid attribute value can be any string but must be unique on the page. The class name block class can be any string that could identify a class of an HTML div construct. A template designer can thus place different kinds of blocks in different places on the page, and style them differently.

If the blocks id is not specified then the value of the block class will be used as the blocks id as well as the block class. This is for backwards-compatibility; use of block classes without blocks ids is deprecated.

If the template designer does not wish to have different kinds of block or differently styled blocks, all blocks on a page can be placed in a single div without a class simply by including

<blocks />

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

Edit

The extension construct

<edit />

displays a button for the user to edit the page if it is not currently being edited, or to display the page without edit buttons if it is currently being edited.

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

Forms

The extension construct

<forms />

inserts forms into the page to enable the user to set page attributes. The forms are only inserted when the page is being edited. The forms for each kind of page are system-defined and cannot be changed by the user.

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

Help

The extension construct

<help />

displays a button for the user to display help text relevant to the current page.

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

Horizontal Menu

The HTML construct

<div class="sodahorizontalmenu" menu="Menu Identifier"></div>

inserts a horizontal menu.

  • Menu Identifier is a text string chosen by the page designer that uniquely identifies the menu. The same menu can be shown on different pages by using the same identifier. Menu items can be added, changed, moved and deleted when the page is edited.

This construct should be used instead of the menu construct (below)  for horizontal menus. The menu construct can be used for vertical menus, and is retained for backwards compatibility.

As well as in templates, this construct can be used in edited blocks. Click the three dots at the right of the block editor menu ("More Misc") then click <> to bring up Code View. You can then edit the block HTML directly.

The menu items that are created will have the same write access level as the page they were created on, or that they were last edited on. This may be different from the access level of the user that creates or edits them, but must be inferior to it. It may also be different to the write access level of other pages on which they appear.

Inserts

The HTML construct

<div class="sodainsert">insert reference</div>

is replaced by the text insert with reference insert reference. The insert reference is the location of a file containing the text to be inserted, relative to a root path that is defined when the Soda implementation is installed. This mechanism provides a folder of files containing frequently-used pieces of text that can be held in an appropriate place on the system, depending on the needs of the installation.

Menu

The extension construct

<menu nameunknown="Menu Item Name" pageunknown="Menu Item Page URL" currentpageassignment="Menu Title">View Reference</menu>

inserts a page menu.

  • Menu Item Name is the name of an unknown whose values are the names of the menu items.
  • Menu Item Page URL is the name of an unknown whose values are the URLs  of the pages containing the menu items. (They can be relative URLs, relative to the pages on which the menu is displayed.)
  • Menu Title is the name of a page assignment whose value for a page containing a menu item is the name of the menu item.
  • View Reference is a reference that specifies the view defining the menu to display. This is a string containing the workspace and location, as would be provided in the path info of a servlet request, but WITHOUT an initial / character. Menu Item Name and Menu Item Page URL are unknowns of that view.

The horizontal menu construct (above) should be used instead of this one for horizontal menus. This construct can be used for vertical menus, and is retained for backwards compatibility.

Navigation

The extension construct

<nav />

displays a button to display the navigation index.

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

Remote HTML

The extension construct

<remote src="url" id="divid" class="divclass" />

inserts a <div> construct containing HTML from a given URL.

  • url is the URL from which the remote HTML is retrieved. This should be an HTML fragment generated by a web service, rather than a complete page. (To insert a complete page, use the HTML iframe construct.)
  • divid is optional. If supplied, it will be the id of the inserted <div>
  • divclass is optional. If supplied, it will be the class of the inserted <div>.

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

User

The extension construct

<user />

displays the user button for the user to establish their identity and select a role.

This construct should be included in a page template but not in a block. If it is in a block it is ignored.

Values of Unknowns

The HTML construct

<span class="sodavalue">UNKNOWN</span>

is replaced by the value assigned to the unknown named UNKNOWN.

Views

The HTML construct

<div class="sodaview" sodawritelevel="write level" sodaplugin="plugin name">view location</div>

is replaced by the view of the data defined at view location. The location of a view is the URL of the view page relative to the base URL of the Soda installation, with no leading slash character.

The value of the sodawritelevel attribute, if supplied, specifies an access level such that a user working in a role that is superior to it can use the view to change data in the connected sources. When a user displays the page and is not working at such a level, or if the sodawritelevel attribute was not supplied, the view's add, edit and delete buttons are not shown, and the user is not able to use the view to change data in the connected sources.

The value of the sodaplugin attribute, if supplied, is the name of a view plugin. This is used for some system-defined views.