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

weeya1年前JTBC教程586

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_07核心团队合作伙伴

核心团队team/荣誉资质honor,有列表页,有内容页{@}<a href="./?type=detail&amp;id={$id}" class="id...

J5_11增加手机站

1、Public/common/diplomat/index.php文件    return Jtbc::take('index.index');替换成&...

J5_04产品新闻列表页

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

J5_10多语言

多语言/Public/console/common/language/sel_lang.jtbc增加节点不同语言不同模板Public/common/diplomat/index.php修改return...

J5列表中获取当前分类的父分类ID

以新闻模块为例子。打开/news/common/diplomat/index.php找到public function list(Request $req, Response $res)函数修改以下内...

J5_08留言模块

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

发表评论    

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