J5_02公共模板
头部尾部
<TITLE>{$=$htmlEncode(implode(' - ', array_reverse($meta_title)))}</TITLE>
<META NAME="Keywords" CONTENT="{$=$htmlEncode($meta_keywords)}">
<META NAME="Description" CONTENT="{$=$htmlEncode($meta_description)}">
图片css文件放在/jtbc/Public/common/assets/static/
路径调用{$=$root_assets_path}/static/
<ul>
<li><a href="{$=$getActualRoute('./')}">{$=$take('global.communal.home', 'lng')}</a></li>
<li genre="aboutus"><a href="{$=$getActualRoute('aboutus/')}">{$=$take('global.aboutus:index.title', 'lng')}</a></li>
<li genre="product"><a href="{$=$getActualRoute('product/')}">{$=$take('global.product:index.title', 'lng')}</a></li>
<li genre="news"><a href="{$=$getActualRoute('news/')}">{$=$take('global.news:index.title', 'lng')}</a></li>
<li genre="team"><a href="{$=$getActualRoute('team/')}">{$=$take('global.team:index.title', 'lng')}</a></li>
<li genre="partnership"><a href="{$=$getActualRoute('partnership/')}">{$=$take('global.partnership:index.title', 'lng')}</a></li>
<li genre="recruitment"><a href="{$=$getActualRoute('recruitment/')}">{$=$take('global.recruitment:index.title', 'lng')}</a></li>
</ul>
导航调用分类{$=$render('global.render.product-index-div', $fetch(['genre' => 'universal/category', 'where' => ['genre' => 'product', 'father_id' => 0]]))}
模块变量分类URL:{@}<a href="../{$genre}/?type=list&category={$id}">{$title}</a>{@}
调用关于我们列表{$=$render('global.render.header-about-li', $fetch(['genre' => 'aboutus', 'limit' => 10]))}
节点代码:{@}<a class="dropdown-item" href="/aboutus/?type=detail&id={$id}">{$title}</a>{@}
页尾JS加上,不然面包屑和分页不显示<script type="module">import('./{$=$root_assets_path}/js/jtbc.js').then(module => { window.jtbc = new module.default(); });</script>
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~··
调用一级分类和二级分类循环调用代码
{$=$render('global.render.header-product-list', $fetch(['genre' => 'universal/category', 'where' => ['genre' => 'product', 'father_id' => 0]]))}
其中header-product-list节点代码
<ul class="dropdown-menu">
{@}<li class="dropdown-submenu">
<a class="dropdown-item" href="../{$genre}/?type=list&category={$id}">{$title}</a>
<ul class="dropdown-menu">
{$=$render('global.render.header-product-list-2', $fetch(['genre' => 'universal/category', 'where' => ['genre' => '{$genre}','father_id' => '{$id}'], 'limit' => 10]))}
</ul>
</li>{@}
</ul>
其中header-product-list-2节点代码
{@}<li>
<a class="dropdown-item" href="../{$genre}/?type=list&category={$id}">{$title}</a>
</li>
{@}
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~··