Basic objects
Name | Type | Description |
---|---|---|
cssUrl |
string |
The style file url for knowledge base. |
breadcrumbs |
string |
Breadcrumb Navigation. |
name |
string |
Knowledge base or category name. |
url |
string |
Knowledge base or category url. |
ifRootCategory |
boolean |
It control the layout of home page and category. |
categories |
object |
A collection of categories under the current knowledge base or category. |
articles |
object |
A collection of articles under the current category. |
popularArticles |
object |
A collection of articles under the current category, it show only on the home page. |
breadcrumbs → {string}
Breadcrumb Navigation.
For example:
<div class="breadcrumbs">
{{breadcrumbs}}
<div>
ifRootCategory → {boolean}
It control the layout of home page and category page.
For example:
{% if ifRootCategory %}
Show something about home page!
{% else %}
Show something about category page!
{% endif %}
categories → {object}
A collection of categories under the current knowledge base or category.
Category Object Properties:
Name | Type | Description |
---|---|---|
id |
number |
Category Id. |
name |
string |
Category name. |
url |
string |
Category url. |
self_total_articles |
number |
The number of articles in the current category. |
total_articles |
number |
The number of articles in the current category(include sub-categories). |
categories |
object |
A collection of sub-categories under the current category. |
articles |
number |
A collection of articles under the current category. |
For example:
{% for category in categories %}
<div class="category__item">
<a href="{{category.url}}">{{category.name}}[{{category.total_articles}}]</a>
<div>
{% for article in category.articles limit:5 %}
<div class="article-list__title">
{% if article.if_featured %}
<i class="iconfont icon-feature"></i>
{% endif %}
<a href="{{article.url}}">{{article.title}}</a>
</div>
{% endfor %}
{% for subcategory in category.categories %}
<div class="subcategory-list folded ">
<i class="iconfont icon-folder"></i>
<div class="category-list__item__sub__name"><a href="{{subcategory.url}}">{{subcategory.name}}</a>
</div>
<div class="category-list__item__artilceNumber">{{subcategory.total_articles}}</div>
</div>
{% endfor %}
{% endfor %}
articles → {object}
A collection of articles under the current category.
Article Object Properties:
Name | Type | Description |
---|---|---|
id |
number |
Article Id. |
title |
string |
Article title. |
url |
string |
Article url. |
if_featured |
boolean |
Flag the article is featured. |
body |
string |
Article body. |
views |
number |
The views of article. |
For example:
{% for article in articles %}
<div class="article-list__title">
{% if article.if_featured %}
<i class="iconfont icon-feature"></i>
{% endif %}
<a href="{{article.url}}">{{article.title}}</a>
</div>
{% endfor %}
popularArticles → {object}
A collection of popular's articles under the current category.
Article Object Properties:
Name | Type | Description |
---|---|---|
id |
number |
Article Id. |
title |
string |
Article title. |
url |
string |
Article url. |
if_featured |
boolean |
Flag the article is featured. |
body |
string |
Article body. |
views |
number |
The views of article. |
For example:
{% for article in popularArticles limit:5 %}
<div class="article-list__title">
{% if article.if_featured %}
<i class="iconfont icon-feature"></i>
{% endif %}
<a href="{{article.url}}">{{article.title}}</a>
</div>
{% endfor %}