+4420 3290 2266

info@coldcore.com

Project Haala

Documentation

JavaScript CMS Web frontend

This page comments on /haala/mere-cms.js file.

CMS supports:

  • Changing text
  • Uploading pictures
  • Uploading custom files

Resource altering is done via pop-up frames. In case of multilingual the frame will also have tabs for each supported language. The resource to be altered is visible in the frame (does not apply to custom files for which download link is present).

Anchors

CMS looks for HTML elements with data-cms attributes defining resources to edit. For each such element it creates an anchor. Anchor is a tiny visible DIV placed at the same position as the element itself. By clicking on an anchor a user can edit resources bound to the anchor. Multiple resources can be bound to a single anchor.

DATA attribute explained

mode - [number][symbols]
number: 1 - pic, 2 - text, 3 - non-multilingual text, 4 - file
symbols (optional): any symbols to query label

Simple block

mode:key:suffix
key: key of a resource to alter
suffix (optional): j / b - append to site key when reading or altering a resource
For example
  • 1:web/gfx/x/019.gif
  • 2:homeeP.107
  • 2t:ttl.p00047
  • 3d:met.d000473 is for non-multilingual text, 3d queries cms.ed_3d label for anchor title, met.d00047 is a resource to alter
  • 2:bb_glfac.001:b2 is for text, 2 queries cms.ed_2 label for anchor title, bb_glfac.001 is a resource to alter, b is a site key suffix

Collection of multiple keys (feat. label modifier and formatting)

mode:key,key...key:suffix:modifier
modifier (optional): display embedded resources titles and format those as
  • n (one per row) → #1 #2 #3 ...
  • n0 (one per row) → #0 #1 #2 ...
  • kv (key/value per row) → #1 #1, #2 #2, #3 #3 ...
  • kv0 (key/value per row) → #0 #0, #1 #1, #2 #2 ...
For example
  • 2v:homeeP.107,homeeP.108,homeeP.109::n → example of select tag (containing only text) - 2v queries cms.ed_2v / cms.ed_2va labels for anchor and edit frame text titles, following by text entries to alter, n formats displaying resources as list.
  • 2p:my.first,,my.key1,my.val1,my.key2,my.val2::kv0 → example of select tag (containing key/value pairs) with initial pair - 2p queries cms.ed_2p / cms.ed_2pa / cms.ed_2pb labels for anchor and edit frame key/value titles, my.first is initial pair key displayed by default in the select tag (,, means it has no value), following by the rest of key/value pairs to alter, kv0 formats displaying resources as pairs.

All keys share the same mode and suffix thus can be applied to text or files but not both at the same time. The collection of blocks below removes this restriction but it is more verbose and does not provide any formatting.

Collection of blocks

label;mode:key:suffix; ... mode:key:suffix
label: any symbols to query label
For example
  • pg;2t:ttl.p00047;3k:met.k00047;3d:met.d00047;4c:web/css/custom.css → this will embed 4 simple blocks: one text, two non-multilingual text and one file - pg queries label cms.ed_pg for anchor title, following by simple block resources.
sitemap