Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • micrantha Friend
    #157947

    Hello,
    I would very much appreciate if anybody could help me on with this:

    In head of index.php I need to get the category id (catid) of the article or blog page which is openend.
    When I have this integer I next could load a special template file to add some color rules for this category.

    I could for example add this line:

    <link rel="stylesheet" href="<?php echo $this->baseurl; ?>/templates/ja_purity/css/category-<? echo $catid; ?>.css"

    The output would be a template file category-15 or any number of the actual category.
    But how to get it?

    As far as I can see there are two situations in which I have to get the catid:
    1. page view is category list or category blog
    2. page view is article

    I hope someone more at home in php on this forum can help me on.

    Thank you in advance,
    Micrantha

    Sherlock Friend
    #369067

    Dear micrantha,

    It is easy to get the the catid if you are in the category view, with the article view it would be more harder, You can try with the below code to get the category id in the category view

    <?php if(JRequest::getVar(‘view’, null, ‘default’, ‘cmd’) == ‘category’) { ?>
    <link rel=”stylesheet” href=”<?php echo $this->baseurl; ?>/templates/ja_purity/css/category-<? echo JRequest::getVar(‘id’); ?>.css”
    <?php } ?>

Viewing 2 posts - 1 through 2 (of 2 total)

This topic contains 2 replies, has 2 voices, and was last updated by  Sherlock 13 years, 11 months ago.

We moved to new unified forum. Please post all new support queries in our New Forum