0
votes

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

1 Answers

4
votes

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