-
AuthorPosts
-
christofferl Friend
christofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
February 15, 2016 at 9:15 pm #883828See attached image.
I need help in trying to add to the JA K2 Filter template so that the K2 category is in vertical alignment to the Extra Fields items. As it is now it is too much to the left.
Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
February 16, 2016 at 4:02 am #883983Hi,
JA K2 Filter uses K2 Template to display the Result page, so in order to change the style of Category, go to file K2 template of your site and add class for Category code as Extra Fields items.
For example: in filecomponentscom_k2templatesdefaultcategory_item.php
has code to display category name
<div class="catItemCategory"> <span><?php echo JText::_('K2_PUBLISHED_IN'); ?></span> <a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a> </div>
then I will change the class name to similar as K2 Extra field items.
<div class=catItemExtraFields"> <span class="catItemExtraFieldsLabel"><?php echo JText::_('K2_PUBLISHED_IN'); ?></span> <span class="catItemExtraFieldsValue"><a href="<?php echo $this->item->category->link; ?>"><?php echo $this->item->category->name; ?></a></span> </div>
based on the code of your site, you can custom the category code to style you want.
christofferl Friendchristofferl
- Join date:
- January 2011
- Posts:
- 233
- Downloads:
- 30
- Uploads:
- 101
- Thanks:
- 21
- Thanked:
- 2 times in 1 posts
February 16, 2016 at 8:25 am #884174I am a super user … not a coder … so I will try to see if I can understand this. But before I do, please confirm that this is "future proof" when it comes to upgrading the K2 component it self.
Would it be possible to as an alternative way, use the custom.css approach instead?
Luna Garden ModeratorLuna Garden
- Join date:
- July 2011
- Posts:
- 2617
- Downloads:
- 80
- Uploads:
- 96
- Thanks:
- 78
- Thanked:
- 453 times in 425 posts
February 17, 2016 at 4:24 am #884890Would it be possible to as an alternative way, use the custom.css approach instead?
I have checked your site, you can add these lines to your CSS file:
.catItemCategory span { display: block; float: left; font-weight: bold; margin: 0 4px 0 0; width: 30%; color: #0a0a0a!important; }
1 user says Thank You to Luna Garden for this useful post
AuthorPostsViewing 4 posts - 1 through 4 (of 4 total)This topic contains 3 replies, has 2 voices, and was last updated by Luna Garden 8 years, 8 months ago.
We moved to new unified forum. Please post all new support queries in our New Forum
Possible to adjust the K2 category alignment so it will be as the extra field?
Viewing 4 posts - 1 through 4 (of 4 total)