Basic Tags
{jv:include}Include a sub-template file to reuse header/footer parts
Sintaks{jv:include file='header.html' /}
Parameter
| Nama | Deskripsi |
file | Sub-template filename relative to the template directory |
Contoh{jv:include file='header.html' /}
页面内容
{jv:include file='footer.html' /}
{jv:lang}Output a language pack string in the current site language
Sintaks{jv:lang name='view_more' /}
Parameter
| Nama | Deskripsi |
name | Language key in languages/{locale}/web.php |
Contoh<span>{jv:lang name='view_more' /}</span>
{jv:global}Output a system setting (multilingual aware)
Sintaks{jv:global name='site_name' /}
Parameter
| Nama | Deskripsi |
name | Setting key such as site_name, site_keywords |
Contoh<title>{jv:global name='site_name' /}</title>
{jv:config}Output a system config value (language independent)
Sintaks{jv:config name='icp' /}
Parameter
| Nama | Deskripsi |
name | Config key |
Contoh{jv:config name='icp' /}
{jv:url}URL prefix tag, prepends current language path prefix
Sintaks{jv:url}list/4.html
Contoh<a href="{jv:url}list/4.html">新闻中心</a>
{jv:assign}Assign a variable inside the template
Sintaks{jv:assign name="x" value="1" /}
Parameter
| Nama | Deskripsi |
name | Variable name |
value | Value |
Contoh{jv:assign name="col" value="3" /}
{jv:col}
{jv:define}Define a PHP constant
Sintaks{jv:define name="MY_CONST" value="abc" /}
Parameter
| Nama | Deskripsi |
name | Constant name |
value | Value |
Contoh{jv:define name="SITE_COL" value="5" /}
{jv:hook}Plugin hook, outputs mounted plugin content
Sintaks{jv:hook name='index_top' /}
Parameter
| Nama | Deskripsi |
name | Hook name (plugins listen to template_{name}) |
Contoh{jv:hook name='footer_ad' /}
{jv:php}Run native PHP code inside templates (use with care)
Sintaks{jv:php}...{/jv:php}
Contoh{jv:php}echo date('Y');{/jv:php}
{jv:count}Output total article count of a category
Sintaks{jv:count typeid="4" /}
Parameter
| Nama | Deskripsi |
typeid | Category ID |
Contoh共 {jv:count typeid="4" /} 篇文章
Article Tags
{jv:artlist}Article list loop, the core data tag
Sintaks{jv:artlist typeid="4" loop="10" orderby="new" flag="c" titlelen="30" infolen="80"}...{/jv:artlist}
Parameter
| Nama | Deskripsi |
typeid | Category ID (empty = current) |
loop / row | Row count, default 10 |
limit | "0,10" format: offset,count |
orderby | Sort: new / hot / rand |
flag | Flag filter: c/h/a/s/p |
noflag | Exclude flags |
keyword | Keyword filter |
idlist | Comma separated article IDs |
subday | Articles within N days |
titlelen | Title truncate length |
infolen | Summary truncate length |
Contoh{jv:artlist typeid="4" loop="8" orderby="new" flag="c"}
<a href="{jv:arcurl}">
<img src="{jv:litpic}" alt="{jv:title}">
<h3>{jv:title|text_overflow='20',###}</h3>
<span>{jv:add_time|MyDate='Y-m-d',###}</span>
</a>
{/jv:artlist}
{jv:artone}Fetch a single article
Sintaks{jv:artone aid="1"}...{/jv:artone}
Parameter
| Nama | Deskripsi |
aid | Article ID |
Contoh{jv:artone aid="1"}
<h2>{jv:title}</h2>
{/jv:artone}
{jv:arthot}Shortcut tags for hot/new/random/recommended articles, same params as artlist
Sintaks{jv:arthot typeid="4" loop="5"}...{/jv:arthot}
Parameter
| Nama | Deskripsi |
loop | Count |
typeid | Category ID |
Contoh{jv:arthot loop="5"}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:arthot}
{jv:relevarticle}Related articles (same category), alias likearticle
Sintaks{jv:relevarticle loop="5"}...{/jv:relevarticle}
Parameter
| Nama | Deskripsi |
loop | Count, default 5 |
orderby | Sort |
Contoh{jv:relevarticle loop="6"}
<li><a href="{jv:arcurl}">{jv:title}</a></li>
{/jv:relevarticle}
{jv:beafter}Previous/next article
Sintaks{jv:beafter get='pre'}...{jv:else /}...{/jv:beafter}
Parameter
| Nama | Deskripsi |
get | pre or next |
Contoh{jv:beafter get='pre'}
<a href="{jv:arcurl}">{jv:title}</a>
{jv:else /}
<span>没有了</span>
{/jv:beafter}
{jv:tag}Output tags of current article with links
Sintaks{jv:tag}...{/jv:tag}
Contoh{jv:tag}
<a href="{jv:link}">{jv:tag}</a>
{/jv:tag}
{jv:artcount}Article statistics count
Sintaks{jv:artcount typeid="4" /}
Parameter
| Nama | Deskripsi |
typeid | Category ID |
Contoh{jv:artcount typeid="4" /}
{jv:listitem}List page rows loop (with pagination)
Sintaks{jv:listitem}...{/jv:listitem}
Contoh{jv:listitem}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:listitem}
{jv:pagelist}Pagination output (first/prev/pages/next/last)
{jv:position}Current position navigation
Q&A Tags
{jv:qacatlist}Q&A category list
Sintaks{jv:qacatlist}...{/jv:qacatlist}
Contoh{jv:qacatlist}
<a href="{jv:url}list/{jv:id}.html">{jv:name}</a>
{/jv:qacatlist}
{jv:qanewlist}Latest questions, filter by status
Sintaks{jv:qanewlist num="10" status="all"}...{/jv:qanewlist}
Parameter
| Nama | Deskripsi |
num | Count, default 10 |
status | all / solved / waiting / bounty |
Contoh{jv:qanewlist num="12" status="solved"}
<a href="{jv:arcurl}">{jv:title}</a><em>{jv:answer_count}</em>
{/jv:qanewlist}
{jv:qahotlist}Hot questions
Sintaks{jv:qahotlist num="10"}...{/jv:qahotlist}
Contoh{jv:qahotlist num="5"}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:qahotlist}
{jv:qaunsolved}Unsolved questions
Sintaks{jv:qaunsolved num="5"}...{/jv:qaunsolved}
Parameter
| Nama | Deskripsi |
num | Count, default 5 |
Contoh{jv:qaunsolved num="5"}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:qaunsolved}
{jv:qacatlistbyid}Questions of a given Q&A category
Sintaks{jv:qacatlistbyid typeid="2" num="10"}...{/jv:qacatlistbyid}
Parameter
| Nama | Deskripsi |
typeid | Q&A category ID |
num | Count |
Contoh{jv:qacatlistbyid typeid="2" num="8"}
<li>{jv:title}</li>
{/jv:qacatlistbyid}
{jv:answerlist}Answers of current question (detail page)
Sintaks{jv:answerlist}...{/jv:answerlist}
Contoh{jv:answerlist}
<div class="ans">{jv:content}</div>
{/jv:answerlist}
{jv:qabest}Best answers / solved questions / question count
Contoh{jv:qabest num="5"}...{/jv:qabest}
Mall Tags
{jv:mallcat}Mall category list
Sintaks{jv:mallcat}...{/jv:mallcat}
Contoh{jv:mallcat}
<a href="{jv:mall_cat_url}">{jv:name}</a>
{/jv:mallcat}
{jv:mallproductlist}Product list loop
Sintaks{jv:mallproductlist num="8" orderby="featured" typeid="0"}...{/jv:mallproductlist}
Parameter
| Nama | Deskripsi |
num | Count, default 8 |
orderby | featured / new / sales / hot |
typeid | Product category ID |
Contoh{jv:mallproductlist num="4"}
<a href="{jv:arcurl}"><img src="{jv:litpic}">{jv:title}</a>
{/jv:mallproductlist}
{jv:mallhot}Hot / new / related product shortcuts
Sintaks{jv:mallhot num="8"}...{/jv:mallhot}
Contoh{jv:mallhot num="4"}
<li>{jv:title}</li>
{/jv:mallhot}
{jv:mallbeafter}Previous/next product
Sintaks{jv:mallbeafter get='pre'}...{jv:else /}...{/jv:mallbeafter}
Parameter
| Nama | Deskripsi |
get | pre / next |
Contoh{jv:mallbeafter get='next'}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:mallbeafter}
{jv:mallbrandlist}Brand list / product category tree
Sintaks{jv:mallbrandlist}...{/jv:mallbrandlist}
Contoh{jv:mallbrandlist}
<img src="{jv:logo}">{jv:name}
{/jv:mallbrandlist}
System & Extra
{jv:slide}Slideshow data
Sintaks{jv:slide}...{/jv:slide}
Contoh{jv:slide}
<a href="{jv:link}"><img src="{jv:pic}"></a>
{/jv:slide}
{jv:ad}Ad slot output
Sintaks{jv:ad name="index_top" /}
Parameter
| Nama | Deskripsi |
name | Ad slot name |
Contoh{jv:ad name="index_top" /}
{jv:flink}Friend links
Sintaks{jv:flink}...{/jv:flink}
Contoh{jv:flink}
<a href="{jv:url}">{jv:name}</a>
{/jv:flink}
{jv:tagcloud}Tag cloud
Sintaks{jv:tagcloud num="20"}...{/jv:tagcloud}
Contoh{jv:tagcloud num="30"}
<a href="{jv:link}">{jv:tag}</a>
{/jv:tagcloud}
{jv:stats}Site statistics
Sintaks{jv:stats name="article" /}
Parameter
| Nama | Deskripsi |
name | Stat item |
Contoh{jv:stats name="article" /}
{jv:userbox}User login box
{jv:collect}Collection data loop
Sintaks{jv:collect}...{/jv:collect}
Contoh{jv:collect}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:collect}
{jv:downloadlist}Download attachment list
Sintaks{jv:downloadlist}...{/jv:downloadlist}
Contoh{jv:downloadlist}
<a href="{jv:downurl}">{jv:name}</a>
{/jv:downloadlist}
{jv:joblist}Job list
Sintaks{jv:joblist}...{/jv:joblist}
Contoh{jv:joblist}
<h4>{jv:title}</h4>
{/jv:joblist}
{jv:sql}Custom SQL query loop (advanced)
Sintaks{jv:sql sql="SELECT ..."}...{/jv:sql}
Parameter
| Nama | Deskripsi |
sql | SELECT statement |
Contoh{jv:sql sql="SELECT id,title FROM jv_article LIMIT 5"}
<li>{jv:title}</li>
{/jv:sql}
Variables & Filters
{jv:variable}Output variable: {jv:name}, array via dot syntax {jv:vo.title}
Sintaks{jv:title} {jv:vo.title}
Contoh<h1>{jv:title}</h1>
<span>{jv:cat_name}</span>
{jv:filter}Variable filters: MyDate (date), text_overflow (truncate), cn_substr (CN substring)
Sintaks{jv:add_time|MyDate='Y-m-d',###}
{jv:title|text_overflow='20',###}
Parameter
| Nama | Deskripsi |
MyDate | Date format (date() pattern) |
text_overflow | Truncate with ellipsis |
cn_substr | Substring for CN/EN text |
Contoh{jv:add_time|MyDate='m-d H:i',###}
{jv:description|text_overflow='50',###}
{jv:field}Detail-page field aliases: field.title, field.keywords, field.content, field.click, field.pubdate, field.typeurl, field.arcurl, etc.
Sintaks{jv:field.title /} {jv:field.content /}
Contoh<title>{jv:field.title /}</title>
<meta name="description" content="{jv:field.description /}">
{jv:global}Global aliases: cfg_webname, cfg_keywords, cfg_description, cfg_templeturl, cfg_basehost
Sintaks{jv:global.cfg_webname /}
Contoh<title>{jv:global.cfg_webname /}</title>
<link href="{jv:global.cfg_templeturl /}skin/css/style.css">
{jv:autoindex}Auto increment index inside loops, starts from 1
Contoh{jv:artlist loop="5"}
<li><i>{jv:autoindex}</i>{jv:title}</li>
{/jv:artlist}