Basic Tags

{jv:include}Include a sub-template file to reuse header/footer parts
Syntaxe
{jv:include file='header.html' /}
Paramètres
NomDescription
fileSub-template filename relative to the template directory
Exemple
{jv:include file='header.html' /}
页面内容
{jv:include file='footer.html' /}
{jv:lang}Output a language pack string in the current site language
Syntaxe
{jv:lang name='view_more' /}
Paramètres
NomDescription
nameLanguage key in languages/{locale}/web.php
Exemple
<span>{jv:lang name='view_more' /}</span>
{jv:global}Output a system setting (multilingual aware)
Syntaxe
{jv:global name='site_name' /}
Paramètres
NomDescription
nameSetting key such as site_name, site_keywords
Exemple
<title>{jv:global name='site_name' /}</title>
{jv:config}Output a system config value (language independent)
Syntaxe
{jv:config name='icp' /}
Paramètres
NomDescription
nameConfig key
Exemple
{jv:config name='icp' /}
{jv:url}URL prefix tag, prepends current language path prefix
Syntaxe
{jv:url}list/4.html
Exemple
<a href="{jv:url}list/4.html">新闻中心</a>
{jv:assign}Assign a variable inside the template
Syntaxe
{jv:assign name="x" value="1" /}
Paramètres
NomDescription
nameVariable name
valueValue
Exemple
{jv:assign name="col" value="3" /}
{jv:col}
{jv:define}Define a PHP constant
Syntaxe
{jv:define name="MY_CONST" value="abc" /}
Paramètres
NomDescription
nameConstant name
valueValue
Exemple
{jv:define name="SITE_COL" value="5" /}
{jv:hook}Plugin hook, outputs mounted plugin content
Syntaxe
{jv:hook name='index_top' /}
Paramètres
NomDescription
nameHook name (plugins listen to template_{name})
Exemple
{jv:hook name='footer_ad' /}
{jv:php}Run native PHP code inside templates (use with care)
Syntaxe
{jv:php}...{/jv:php}
Exemple
{jv:php}echo date('Y');{/jv:php}
{jv:count}Output total article count of a category
Syntaxe
{jv:count typeid="4" /}
Paramètres
NomDescription
typeidCategory ID
Exemple
共 {jv:count typeid="4" /} 篇文章

Flow Control

{jv:if}Conditional rendering with comparison/logic expressions
Syntaxe
{jv:if condition='表达式'}...{jv:elseif condition='...' /}...{jv:else /}...{/jv:if}
Paramètres
NomDescription
conditionExpression like (price==0)
Exemple
{jv:if condition='(price==0)'}
  <span>免费</span>
{jv:else /}
  <span>¥{jv:price}</span>
{/jv:if}
{jv:foreach}Iterate an array variable
Syntaxe
{jv:foreach name="list" item="v" key="k"}...{/jv:foreach}
Paramètres
NomDescription
nameArray variable
itemValue name
keyKey name (optional)
Exemple
{jv:foreach name="list" item="v"}
  <li>{jv:v.title}</li>
{/jv:foreach}
{jv:volist}Data list loop (similar to foreach)
Syntaxe
{jv:volist name="list" id="vo"}...{/jv:volist}
Paramètres
NomDescription
nameArray variable
idRow name
Exemple
{jv:volist name="list" id="vo"}
  <li>{jv:vo.title}</li>
{/jv:volist}
{jv:for}Counter loop
Syntaxe
{jv:for start="1" end="10" step="1" name="i"}...{/jv:for}
Paramètres
NomDescription
startStart
endEnd
stepStep
nameLoop variable
Exemple
{jv:for start="1" end="5" name="i"}
  <span>{jv:i}</span>
{/jv:for}
{jv:switch}Multi-branch switch
Syntaxe
{jv:switch name="type"}{jv:case value="1"}...{/jv:case}{jv:default}...{/jv:default}{/jv:switch}
Paramètres
NomDescription
nameVariable
valueMatch value
Exemple
{jv:switch name="model"}
{jv:case value="article"}文章{/jv:case}
{jv:default}其他{/jv:default}
{/jv:switch}

Navigation & Category

{jv:nav}Loop through site navigation categories
Syntaxe
{jv:nav type="" typeid="" row="10" currentstyle="active"}...{/jv:nav}
Paramètres
NomDescription
typeCategory type (empty = all)
typeidParent category ID
rowRow limit
currentstyleCSS class appended for the current category
Exemple
{jv:nav row="10" currentstyle="on"}
  <li class="{jv:currentstyle}"><a href="{jv:url}list/{jv:id}.html">{jv:name}</a></li>
{/jv:nav}
{jv:typelist}List sub-categories of a category
Syntaxe
{jv:typelist type="son" typeid="39"}...{/jv:typelist}
Paramètres
NomDescription
typeson = children
typeidParent category ID
Exemple
{jv:typelist type="son" typeid="39"}
  <a href="{jv:url}list/{jv:id}.html">{jv:name}</a>
{/jv:typelist}
{jv:breadcrumb}Breadcrumb navigation
Syntaxe
{jv:breadcrumb}...{/jv:breadcrumb}
Exemple
{jv:breadcrumb}
  <a href="{jv:typeurl}">{jv:typename}</a>
{/jv:breadcrumb}
{jv:language}Loop enabled site languages (language switcher)
Syntaxe
{jv:language}...{/jv:language}
Exemple
{jv:language}
  <a href="{jv:language_url}">{jv:name}</a>
{/jv:language}

Article Tags

{jv:artlist}Article list loop, the core data tag
Syntaxe
{jv:artlist typeid="4" loop="10" orderby="new" flag="c" titlelen="30" infolen="80"}...{/jv:artlist}
Paramètres
NomDescription
typeidCategory ID (empty = current)
loop / rowRow count, default 10
limit"0,10" format: offset,count
orderbySort: new / hot / rand
flagFlag filter: c/h/a/s/p
noflagExclude flags
keywordKeyword filter
idlistComma separated article IDs
subdayArticles within N days
titlelenTitle truncate length
infolenSummary truncate length
Exemple
{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
Syntaxe
{jv:artone aid="1"}...{/jv:artone}
Paramètres
NomDescription
aidArticle ID
Exemple
{jv:artone aid="1"}
  <h2>{jv:title}</h2>
{/jv:artone}
{jv:arthot}Shortcut tags for hot/new/random/recommended articles, same params as artlist
Syntaxe
{jv:arthot typeid="4" loop="5"}...{/jv:arthot}
Paramètres
NomDescription
loopCount
typeidCategory ID
Exemple
{jv:arthot loop="5"}
  <a href="{jv:arcurl}">{jv:title}</a>
{/jv:arthot}
{jv:relevarticle}Related articles (same category), alias likearticle
Syntaxe
{jv:relevarticle loop="5"}...{/jv:relevarticle}
Paramètres
NomDescription
loopCount, default 5
orderbySort
Exemple
{jv:relevarticle loop="6"}
  <li><a href="{jv:arcurl}">{jv:title}</a></li>
{/jv:relevarticle}
{jv:beafter}Previous/next article
Syntaxe
{jv:beafter get='pre'}...{jv:else /}...{/jv:beafter}
Paramètres
NomDescription
getpre or next
Exemple
{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
Syntaxe
{jv:tag}...{/jv:tag}
Exemple
{jv:tag}
  <a href="{jv:link}">{jv:tag}</a>
{/jv:tag}
{jv:artcount}Article statistics count
Syntaxe
{jv:artcount typeid="4" /}
Paramètres
NomDescription
typeidCategory ID
Exemple
{jv:artcount typeid="4" /}
{jv:listitem}List page rows loop (with pagination)
Syntaxe
{jv:listitem}...{/jv:listitem}
Exemple
{jv:listitem}
  <a href="{jv:arcurl}">{jv:title}</a>
{/jv:listitem}
{jv:pagelist}Pagination output (first/prev/pages/next/last)
Syntaxe
{jv:pagelist /}
Exemple
{jv:pagelist /}
{jv:position}Current position navigation
Syntaxe
{jv:position /}
Exemple
{jv:position /}

Q&A Tags

{jv:qacatlist}Q&A category list
Syntaxe
{jv:qacatlist}...{/jv:qacatlist}
Exemple
{jv:qacatlist}
  <a href="{jv:url}list/{jv:id}.html">{jv:name}</a>
{/jv:qacatlist}
{jv:qanewlist}Latest questions, filter by status
Syntaxe
{jv:qanewlist num="10" status="all"}...{/jv:qanewlist}
Paramètres
NomDescription
numCount, default 10
statusall / solved / waiting / bounty
Exemple
{jv:qanewlist num="12" status="solved"}
  <a href="{jv:arcurl}">{jv:title}</a><em>{jv:answer_count}</em>
{/jv:qanewlist}
{jv:qahotlist}Hot questions
Syntaxe
{jv:qahotlist num="10"}...{/jv:qahotlist}
Paramètres
NomDescription
numCount
Exemple
{jv:qahotlist num="5"}
  <a href="{jv:arcurl}">{jv:title}</a>
{/jv:qahotlist}
{jv:qaunsolved}Unsolved questions
Syntaxe
{jv:qaunsolved num="5"}...{/jv:qaunsolved}
Paramètres
NomDescription
numCount, default 5
Exemple
{jv:qaunsolved num="5"}
  <a href="{jv:arcurl}">{jv:title}</a>
{/jv:qaunsolved}
{jv:qacatlistbyid}Questions of a given Q&A category
Syntaxe
{jv:qacatlistbyid typeid="2" num="10"}...{/jv:qacatlistbyid}
Paramètres
NomDescription
typeidQ&A category ID
numCount
Exemple
{jv:qacatlistbyid typeid="2" num="8"}
  <li>{jv:title}</li>
{/jv:qacatlistbyid}
{jv:answerlist}Answers of current question (detail page)
Syntaxe
{jv:answerlist}...{/jv:answerlist}
Exemple
{jv:answerlist}
  <div class="ans">{jv:content}</div>
{/jv:answerlist}
{jv:qabest}Best answers / solved questions / question count
Syntaxe
{jv:qacount /}
Exemple
{jv:qabest num="5"}...{/jv:qabest}

Forum Tags

{jv:forumlist}Latest forum threads
Syntaxe
{jv:forumlist num="7" orderby="new" titlelen="30"}...{/jv:forumlist}
Paramètres
NomDescription
numCount, default 7
orderbynew / hot
titlelenTitle length
Exemple
{jv:forumlist num="10"}
  <a href="{jv:arcurl}">{jv:title}</a>
{/jv:forumlist}
{jv:forumhot}Hot / digest / best threads
Syntaxe
{jv:forumhot num="7"}...{/jv:forumhot}
Paramètres
NomDescription
numCount
Exemple
{jv:forumessence num="5"}
  <li>{jv:title}</li>
{/jv:forumessence}

Mall Tags

{jv:mallcat}Mall category list
Syntaxe
{jv:mallcat}...{/jv:mallcat}
Exemple
{jv:mallcat}
  <a href="{jv:mall_cat_url}">{jv:name}</a>
{/jv:mallcat}
{jv:mallproductlist}Product list loop
Syntaxe
{jv:mallproductlist num="8" orderby="featured" typeid="0"}...{/jv:mallproductlist}
Paramètres
NomDescription
numCount, default 8
orderbyfeatured / new / sales / hot
typeidProduct category ID
Exemple
{jv:mallproductlist num="4"}
  <a href="{jv:arcurl}"><img src="{jv:litpic}">{jv:title}</a>
{/jv:mallproductlist}
{jv:mallhot}Hot / new / related product shortcuts
Syntaxe
{jv:mallhot num="8"}...{/jv:mallhot}
Paramètres
NomDescription
numCount
Exemple
{jv:mallhot num="4"}
  <li>{jv:title}</li>
{/jv:mallhot}
{jv:mallbeafter}Previous/next product
Syntaxe
{jv:mallbeafter get='pre'}...{jv:else /}...{/jv:mallbeafter}
Paramètres
NomDescription
getpre / next
Exemple
{jv:mallbeafter get='next'}
  <a href="{jv:arcurl}">{jv:title}</a>
{/jv:mallbeafter}
{jv:mallbrandlist}Brand list / product category tree
Syntaxe
{jv:mallbrandlist}...{/jv:mallbrandlist}
Exemple
{jv:mallbrandlist}
  <img src="{jv:logo}">{jv:name}
{/jv:mallbrandlist}

System & Extra

{jv:slide}Slideshow data
Syntaxe
{jv:slide}...{/jv:slide}
Exemple
{jv:slide}
  <a href="{jv:link}"><img src="{jv:pic}"></a>
{/jv:slide}
{jv:ad}Ad slot output
Syntaxe
{jv:ad name="index_top" /}
Paramètres
NomDescription
nameAd slot name
Exemple
{jv:ad name="index_top" /}
{jv:flink}Friend links
Syntaxe
{jv:flink}...{/jv:flink}
Exemple
{jv:flink}
  <a href="{jv:url}">{jv:name}</a>
{/jv:flink}
{jv:tagcloud}Tag cloud
Syntaxe
{jv:tagcloud num="20"}...{/jv:tagcloud}
Paramètres
NomDescription
numCount
Exemple
{jv:tagcloud num="30"}
  <a href="{jv:link}">{jv:tag}</a>
{/jv:tagcloud}
{jv:stats}Site statistics
Syntaxe
{jv:stats name="article" /}
Paramètres
NomDescription
nameStat item
Exemple
{jv:stats name="article" /}
{jv:userbox}User login box
Syntaxe
{jv:userbox /}
Exemple
{jv:userbox /}
{jv:collect}Collection data loop
Syntaxe
{jv:collect}...{/jv:collect}
Exemple
{jv:collect}
  <a href="{jv:arcurl}">{jv:title}</a>
{/jv:collect}
{jv:downloadlist}Download attachment list
Syntaxe
{jv:downloadlist}...{/jv:downloadlist}
Exemple
{jv:downloadlist}
  <a href="{jv:downurl}">{jv:name}</a>
{/jv:downloadlist}
{jv:joblist}Job list
Syntaxe
{jv:joblist}...{/jv:joblist}
Exemple
{jv:joblist}
  <h4>{jv:title}</h4>
{/jv:joblist}
{jv:sql}Custom SQL query loop (advanced)
Syntaxe
{jv:sql sql="SELECT ..."}...{/jv:sql}
Paramètres
NomDescription
sqlSELECT statement
Exemple
{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}
Syntaxe
{jv:title}  {jv:vo.title}
Exemple
<h1>{jv:title}</h1>
<span>{jv:cat_name}</span>
{jv:filter}Variable filters: MyDate (date), text_overflow (truncate), cn_substr (CN substring)
Syntaxe
{jv:add_time|MyDate='Y-m-d',###}
{jv:title|text_overflow='20',###}
Paramètres
NomDescription
MyDateDate format (date() pattern)
text_overflowTruncate with ellipsis
cn_substrSubstring for CN/EN text
Exemple
{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.
Syntaxe
{jv:field.title /}  {jv:field.content /}
Exemple
<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
Syntaxe
{jv:global.cfg_webname /}
Exemple
<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
Syntaxe
{jv:autoindex}
Exemple
{jv:artlist loop="5"}
  <li><i>{jv:autoindex}</i>{jv:title}</li>
{/jv:artlist}