Basic Tags
{jv:include}Include a sub-template file to reuse header/footer parts
構文{jv:include file='header.html' /}
パラメータ
| 名前 | 説明 |
file | Sub-template filename relative to the template directory |
例{jv:include file='header.html' /}
页面内容
{jv:include file='footer.html' /}
{jv:lang}Output a language pack string in the current site language
構文{jv:lang name='view_more' /}
パラメータ
| 名前 | 説明 |
name | Language key in languages/{locale}/web.php |
例<span>{jv:lang name='view_more' /}</span>
{jv:global}Output a system setting (multilingual aware)
構文{jv:global name='site_name' /}
パラメータ
| 名前 | 説明 |
name | Setting key such as site_name, site_keywords |
例<title>{jv:global name='site_name' /}</title>
{jv:config}Output a system config value (language independent)
構文{jv:config name='icp' /}
例{jv:config name='icp' /}
{jv:url}URL prefix tag, prepends current language path prefix
例<a href="{jv:url}list/4.html">新闻中心</a>
{jv:assign}Assign a variable inside the template
構文{jv:assign name="x" value="1" /}
パラメータ
| 名前 | 説明 |
name | Variable name |
value | Value |
例{jv:assign name="col" value="3" /}
{jv:col}
{jv:define}Define a PHP constant
構文{jv:define name="MY_CONST" value="abc" /}
パラメータ
| 名前 | 説明 |
name | Constant name |
value | Value |
例{jv:define name="SITE_COL" value="5" /}
{jv:hook}Plugin hook, outputs mounted plugin content
構文{jv:hook name='index_top' /}
パラメータ
| 名前 | 説明 |
name | Hook name (plugins listen to template_{name}) |
例{jv:hook name='footer_ad' /}
{jv:php}Run native PHP code inside templates (use with care)
例{jv:php}echo date('Y');{/jv:php}
{jv:count}Output total article count of a category
構文{jv:count typeid="4" /}
例共 {jv:count typeid="4" /} 篇文章
Article Tags
{jv:artlist}Article list loop, the core data tag
構文{jv:artlist typeid="4" loop="10" orderby="new" flag="c" titlelen="30" infolen="80"}...{/jv:artlist}
パラメータ
| 名前 | 説明 |
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 |
例{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
構文{jv:artone aid="1"}...{/jv:artone}
例{jv:artone aid="1"}
<h2>{jv:title}</h2>
{/jv:artone}
{jv:arthot}Shortcut tags for hot/new/random/recommended articles, same params as artlist
構文{jv:arthot typeid="4" loop="5"}...{/jv:arthot}
パラメータ
| 名前 | 説明 |
loop | Count |
typeid | Category ID |
例{jv:arthot loop="5"}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:arthot}
{jv:relevarticle}Related articles (same category), alias likearticle
構文{jv:relevarticle loop="5"}...{/jv:relevarticle}
パラメータ
| 名前 | 説明 |
loop | Count, default 5 |
orderby | Sort |
例{jv:relevarticle loop="6"}
<li><a href="{jv:arcurl}">{jv:title}</a></li>
{/jv:relevarticle}
{jv:beafter}Previous/next article
構文{jv:beafter get='pre'}...{jv:else /}...{/jv:beafter}
例{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
例{jv:tag}
<a href="{jv:link}">{jv:tag}</a>
{/jv:tag}
{jv:artcount}Article statistics count
構文{jv:artcount typeid="4" /}
例{jv:artcount typeid="4" /}
{jv:listitem}List page rows loop (with pagination)
構文{jv:listitem}...{/jv:listitem}
例{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
構文{jv:qacatlist}...{/jv:qacatlist}
例{jv:qacatlist}
<a href="{jv:url}list/{jv:id}.html">{jv:name}</a>
{/jv:qacatlist}
{jv:qanewlist}Latest questions, filter by status
構文{jv:qanewlist num="10" status="all"}...{/jv:qanewlist}
パラメータ
| 名前 | 説明 |
num | Count, default 10 |
status | all / solved / waiting / bounty |
例{jv:qanewlist num="12" status="solved"}
<a href="{jv:arcurl}">{jv:title}</a><em>{jv:answer_count}</em>
{/jv:qanewlist}
{jv:qahotlist}Hot questions
構文{jv:qahotlist num="10"}...{/jv:qahotlist}
例{jv:qahotlist num="5"}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:qahotlist}
{jv:qaunsolved}Unsolved questions
構文{jv:qaunsolved num="5"}...{/jv:qaunsolved}
例{jv:qaunsolved num="5"}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:qaunsolved}
{jv:qacatlistbyid}Questions of a given Q&A category
構文{jv:qacatlistbyid typeid="2" num="10"}...{/jv:qacatlistbyid}
パラメータ
| 名前 | 説明 |
typeid | Q&A category ID |
num | Count |
例{jv:qacatlistbyid typeid="2" num="8"}
<li>{jv:title}</li>
{/jv:qacatlistbyid}
{jv:answerlist}Answers of current question (detail page)
構文{jv:answerlist}...{/jv:answerlist}
例{jv:answerlist}
<div class="ans">{jv:content}</div>
{/jv:answerlist}
{jv:qabest}Best answers / solved questions / question count
例{jv:qabest num="5"}...{/jv:qabest}
Mall Tags
{jv:mallcat}Mall category list
構文{jv:mallcat}...{/jv:mallcat}
例{jv:mallcat}
<a href="{jv:mall_cat_url}">{jv:name}</a>
{/jv:mallcat}
{jv:mallproductlist}Product list loop
構文{jv:mallproductlist num="8" orderby="featured" typeid="0"}...{/jv:mallproductlist}
パラメータ
| 名前 | 説明 |
num | Count, default 8 |
orderby | featured / new / sales / hot |
typeid | Product category ID |
例{jv:mallproductlist num="4"}
<a href="{jv:arcurl}"><img src="{jv:litpic}">{jv:title}</a>
{/jv:mallproductlist}
{jv:mallhot}Hot / new / related product shortcuts
構文{jv:mallhot num="8"}...{/jv:mallhot}
例{jv:mallhot num="4"}
<li>{jv:title}</li>
{/jv:mallhot}
{jv:mallbeafter}Previous/next product
構文{jv:mallbeafter get='pre'}...{jv:else /}...{/jv:mallbeafter}
例{jv:mallbeafter get='next'}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:mallbeafter}
{jv:mallbrandlist}Brand list / product category tree
構文{jv:mallbrandlist}...{/jv:mallbrandlist}
例{jv:mallbrandlist}
<img src="{jv:logo}">{jv:name}
{/jv:mallbrandlist}
System & Extra
{jv:slide}Slideshow data
構文{jv:slide}...{/jv:slide}
例{jv:slide}
<a href="{jv:link}"><img src="{jv:pic}"></a>
{/jv:slide}
{jv:ad}Ad slot output
構文{jv:ad name="index_top" /}
例{jv:ad name="index_top" /}
{jv:flink}Friend links
構文{jv:flink}...{/jv:flink}
例{jv:flink}
<a href="{jv:url}">{jv:name}</a>
{/jv:flink}
{jv:tagcloud}Tag cloud
構文{jv:tagcloud num="20"}...{/jv:tagcloud}
例{jv:tagcloud num="30"}
<a href="{jv:link}">{jv:tag}</a>
{/jv:tagcloud}
{jv:stats}Site statistics
構文{jv:stats name="article" /}
例{jv:stats name="article" /}
{jv:userbox}User login box
{jv:collect}Collection data loop
構文{jv:collect}...{/jv:collect}
例{jv:collect}
<a href="{jv:arcurl}">{jv:title}</a>
{/jv:collect}
{jv:downloadlist}Download attachment list
構文{jv:downloadlist}...{/jv:downloadlist}
例{jv:downloadlist}
<a href="{jv:downurl}">{jv:name}</a>
{/jv:downloadlist}
{jv:joblist}Job list
構文{jv:joblist}...{/jv:joblist}
例{jv:joblist}
<h4>{jv:title}</h4>
{/jv:joblist}
{jv:sql}Custom SQL query loop (advanced)
構文{jv:sql sql="SELECT ..."}...{/jv:sql}
例{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}
構文{jv:title} {jv:vo.title}
例<h1>{jv:title}</h1>
<span>{jv:cat_name}</span>
{jv:filter}Variable filters: MyDate (date), text_overflow (truncate), cn_substr (CN substring)
構文{jv:add_time|MyDate='Y-m-d',###}
{jv:title|text_overflow='20',###}
パラメータ
| 名前 | 説明 |
MyDate | Date format (date() pattern) |
text_overflow | Truncate with ellipsis |
cn_substr | Substring for CN/EN text |
例{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.
構文{jv:field.title /} {jv:field.content /}
例<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
構文{jv:global.cfg_webname /}
例<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
例{jv:artlist loop="5"}
<li><i>{jv:autoindex}</i>{jv:title}</li>
{/jv:artlist}