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

weeya2年前JTBC教程968

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_09搜索

    需要在可以被搜索的模块目录中手动添加common/search.jtbc引导文件来激活搜索功能    需要手动构建关键字输入框并通过...

J5网站首页增加SEO标题

网站增加首页标题1、/Public/common/language/communal.jtbc文件增加节点    <item>  &nbs...

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_02公共模板

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

J5_11增加手机站

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

发表评论    

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