Find centralized, trusted content and collaborate around the technologies you use most.
Teams
Q&A for work
Connect and share knowledge within a single location that is structured and easy to search.
我正在尝试通过以下方式获取每个帖子的类别 ID:
$catid = JRequest::getInt('catid');
我把这个脚本放在 blog_item.php
但我对所有帖子都只有 0 分
模板加载了ContentViewCategory. 它只允许一个主要类别,并且可以使用以下方法获取其 id:
ContentViewCategory
$mainCatid = $this->category->id
当前item的直接父id可以通过查询item的catid属性来获得。还有很多其他可用的属性,包括类别名称。
catid
$catid = $this->item->catid