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

weeya2年前JTBC教程1038

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增加tag标签自定义URL

1、index.php文件detail节点$rsTag = strval($rs -> tag);//增加tag模块管理-添加字段tag,16标签输入框。2、tag/矿山副井井筒装备安装/htt...

J5增加PDF附件下载功能

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

J5_09搜索

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

J5_07核心团队合作伙伴

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

J5模块首页-列表分类-文章页面自定义TDK

J5模块首页-列表分类-文章页面自定义TDK方法1、模块添加字段,后台开发维护》模块管理》右边的设置,在模块设置界面,点击右上角添加新字段按钮添加3个字段,用来存储自定义的TDK数据seotitle,...

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

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

发表评论    

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