Keyword

mod_k2_content add active class to li

  • Dinesh Kumar Krishna
  • Dinesh Kumar Krishna's Avatar Topic Author
  • Offline
  • New Member
More
7 years 8 months ago #160150 by Dinesh Kumar Krishna
mod_k2_content add active class to li was created by Dinesh Kumar Krishna
How to add active class to mod_k2_content li items in sef url . I tried below code and its working fine for non sef url.
<?php $id = JRequest::getVar('id'); ?>
    <li class="<?php echo ($key%2) ? "odd" : "even"; if(count($items)==$key+1) echo ' lastItem';echo ($id == $item->id)?" active":"";?>">

Please help me out how it will be done in sef url.

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

  • Dinesh Kumar Krishna
  • Dinesh Kumar Krishna's Avatar Topic Author
  • Offline
  • New Member
More
7 years 8 months ago #160163 by Dinesh Kumar Krishna
Replied by Dinesh Kumar Krishna on topic mod_k2_content add active class to li
I figured it out. It was working fine in SEF also due to joomla cache first clicked li contained active class was getting stored in cache and was not updating for next click.

So i disabled cache for that particular module and its working fine.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
7 years 7 months ago #160261 by Krikor Boghossian
Replied by Krikor Boghossian on topic mod_k2_content add active class to li
Nice to hear that you sorted it out Dinesh.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum