J5详情页获取当前分类父分类ID

weeya1年前JTBC教程469

1、修改程序 /public/zhiwu/common/template/index.jtbc文件

public function detail(Request $req, Response $res)
      //
      $fatherCategory = 0;
      $fatherCategory = $this -> category -> getRecordById($rsCategory, 'father_id') ?: $rsCategory;
      $variables = [
      'category' => $rsCategory,
      'Fcategory' => $fatherCategory,
      ];
      //
     //$variables = ['category' => $rsCategory];屏蔽

2、模板调用
获取ID:{$[Fcategory]}
调用分类名:{$=$render('index.category-detail', $fetch(['genre' => 'universal/category', 'where' => ['genre' => '{$>this.genre}', 'id' => {$[Fcategory]}]]))}

相关文章

J5增加PDF附件下载功能

1、模块管理增加att字段,选择29附件管理器2、模板代码<table class="table table-striped m-0"><tbody><...

J5_08留言模块

联系我们模块放留言板1、/Public/contactus/common/diplomat.index.php文件      $renderer =...

J5_02公共模板

头部尾部    <TITLE>{$=$htmlEncode(implode(' - ', array_reverse($meta_title)...

J5_05产品新闻详情页

1、头尾模板调用代码{$=$take('global.communal.header')}{$=$take('global.communal.footer')}{$ti...

J5_04产品新闻列表页

1、头尾模板调用代码{$=$take('global.communal.header')}{$=$take('global.communal.footer')}1、模块...

J5_06关于我们联系我们内容页

1、头尾模板调用代码{$=$take('global.communal.header')}{$=$take('global.communal.footer')}{$ti...

发表评论    

◎欢迎参与讨论,请在这里发表您的看法、交流您的观点。