dongzi0602 2013-04-02 17:40
浏览 15
已采纳

如果当前文章类别ID是Joomla显示内容

i am using joomla 2.5 and i want to show some special text only in those articles which belongs to category id 11.

to get category id i tried:

<?php $catid = JRequest::getInt('catid'); echo $catid; ?>

to check if current category id is 11 and then show special text i used:

<?php $catid = JRequest::getInt('catid'); if ($catid == 11) {?>SPECIAL TEXT<?php } ?>

but it is not working :( text can be seen in all categories.

  • 写回答

1条回答 默认 最新

  • douning5041 2013-04-02 23:05
    关注

    Your if statement doesn't look right... try this:

    <?php $catid = JRequest::getInt('catid'); if ($catid == 11) : ?>SPECIAL TEXT<?php endif; ?>
    

    See "Alternative syntax for control structures" on php.net

    本回答被题主选为最佳回答 , 对您是否有帮助呢?
    评论

报告相同问题?

悬赏问题

  • ¥15 乌班图ip地址配置及远程SSH
  • ¥15 怎么让点阵屏显示静态爱心,用keiluVision5写出让点阵屏显示静态爱心的代码,越快越好
  • ¥15 PSPICE制作一个加法器
  • ¥15 javaweb项目无法正常跳转
  • ¥15 VMBox虚拟机无法访问
  • ¥15 skd显示找不到头文件
  • ¥15 机器视觉中图片中长度与真实长度的关系
  • ¥15 fastreport table 怎么只让每页的最下面和最顶部有横线
  • ¥15 java 的protected权限 ,问题在注释里
  • ¥15 这个是哪里有问题啊?