Keyword

How to add a class into a specific item? (SOLVED)

  • Carlos Salas
  • Carlos Salas's Avatar Topic Author
  • Offline
  • New Member
More
12 years 7 months ago - 12 years 6 months ago #62800 by Carlos Salas
I solved this after a day but I forgot to publish it, here is the solution.

For overrides open the file yourtemplate/html/com_k2/yourk2template/item.php
For hacks (not recommended) components/com_k2/templates/default/item.php and add this little line of code into <div id="k2Container" class=" leave a space and place the code right here">
<?php echo $this->item->alias; ?>

At the end it should look like this:
<div id="k2Container" class="itemView<?php echo ($this->item->featured) ? ' itemIsFeatured' : ''; ?> <?php echo $this->item->alias; ?>">


Note: This code was for my only purposes. I wanted to add a unique class into every article for style content reasons, so I added the alias of the article as the unique class.

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

  • Carlos Salas
  • Carlos Salas's Avatar Topic Author
  • Offline
  • New Member
More
12 years 6 months ago #62801 by Carlos Salas
Solved..

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


Powered by Kunena Forum