Keyword

custom class releated catid

  • Majdy
  • Majdy's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 2 weeks ago #118526 by Majdy
custom class releated catid was created by Majdy
Hi There
how can make custom class css related to the item category id

for instance <div class="<?php echo "the number of the catid"; ?>">

so what is the Piece of this code "the number of the catid" insted in the php

Please Log in or Create an account to join the conversation.

  • Yiota
  • Yiota's Avatar
  • Visitor
11 years 2 weeks ago #118527 by Yiota
Replied by Yiota on topic Re: custom class releated catid
Hello,

If you want to put this custom class in the category_item.php or the item.php of K2 then you will need this
<?php echo $this->item->category->id; ?>

Please Log in or Create an account to join the conversation.

  • Majdy
  • Majdy's Avatar Topic Author
  • Offline
  • Junior Member
More
11 years 2 weeks ago #118528 by Majdy
Replied by Majdy on topic Re: custom class releated catid

Yiota Ziaggou wrote: Hello,

If you want to put this custom class in the category_item.php or the item.php of K2 then you will need this

<?php echo $this->item->category->id; ?>


Thanks for your respond
i need to insert the code out side the k2 templates so i need it in other 3rd party module that's grab the articles from k2 and i want to make classes in there
i think first i should make a Query after that i insert it as Query output; is there a shorthand way?
thanks

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum