In order to facilitate the flexible and rich functional logic of the frontend, some environmental parameters need to be injected into the frontend.

Cabloy-CMS itself has some built-in environment objects. Meanwhile, you can also inject custom properties through env of the backend context object. These parameters will be merged and then injected into the frontend.

Inject ENV



/ ENV placeholder
_ _ENV_ _

Frontend environment object structure

<script type="text/javascript">
var env={
  "base": {
    "title": "my blog",
    "subTitle": "gone with the wind",
    "description": "",
    "keywords": ""
  "language": {
    "items": "en-us,zh-cn",
    "default": "en-us",
    "current": "en-us"
  "format": {
    "date": "YYYY-MM-DD",
    "time": "HH:mm:ss"
  "comment": {
    "order": "asc",
    "recentNum": 5
  "site": {
    "path": "main/article",
    "serverUrl": "",
    "rawRootUrl": ""
  "article": ...,
  "index": {
    "main/index/index": 20
Name Source Instruction
base Site configuration Site basic information
language Site configuration Language information
format Site configuration Time formatting
comment Site configuration Comment parameter
site Built-in parameters Site parameter
site.path Path indication of current page
site.serverUrl URL prefix of backend service
site.rawRootUrl URL prefix of frontend site
article Built-in parameter If it is an article page, this property is automatically injected.
index Custom parameter Parameters injected by the theme cms-themeblog