Keyword

K2 Item classes

  • Dennis
  • Dennis's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #143228 by Dennis
K2 Item classes was created by Dennis
Hey all,

I am trying to give own CSS classes to K2 Items, so that I can style the items individually. I can't see it in the backend, but also don't know in which file i have to look and what I have to code there.

Looking forward on some helpful information.

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #143230 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Item classes
There is no option for this in the backend, you need to override the item.php file. This post will help you with locating and overriding the item's file (item.php)

www.joomlaworks.net/blog/item/194-k2-inheritance-sub-templating

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

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

  • Dennis
  • Dennis's Avatar Topic Author
  • Offline
  • New Member
More
9 years 5 months ago #143233 by Dennis
Replied by Dennis on topic K2 Item classes
With the help of the tutorial I have made a sub template now, but don't know where I can assign it to the specific item.

I also have created a page class for the menu entry of the page. I can see it when I inspect the element in the browser. I have tried to use the class in the suggested CSS files, but no effect.

Furthermore, when I create a class or a suffix in the backend and inspect it in the browser there is always an additional blank space, e.g. class="itemView _tanz". Why is this?

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

  • Krikor Boghossian
  • Krikor Boghossian's Avatar
  • Offline
  • Platinum Member
More
9 years 5 months ago #143247 by Krikor Boghossian
Replied by Krikor Boghossian on topic K2 Item classes
Once you create the overrides you can directly generate your class (eG: based on the category or the ID directly on the php file)

Futhermore the page's class should not start with an underscore if you want to use it in K2 items / categories.

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