- Posts: 3
COMMUNITY FORUM
CSS class for the FIRST container of each row
- Iwial
- Topic Author
- Offline
- New Member
Less
More
12 years 1 week ago #103944
by Iwial
CSS class for the FIRST container of each row was created by Iwial
Hey everyone,
for a layout i need to assign a class to the first item of each row in the Blog layout of K2. I've got 4 columns. There can be found this in the category.php:
Well, i'm wondering if it is possible to modify this code to reach the first item of a each row (appropriate to this one i want to adress the first item of each row in this way).
Would be very thankful for help.
I.B.
for a layout i need to assign a class to the first item of each row in the Blog layout of K2. I've got 4 columns. There can be found this in the category.php:
<?php
// Define a CSS class for the last container on each row
if( (($key+1)%($this->params->get('num_primary_columns'))==0) || count($this->primary)<$this->params->get('num_primary_columns') )
$lastContainer= ' itemContainerLast';
else
$lastContainer='';
?>
Well, i'm wondering if it is possible to modify this code to reach the first item of a each row (appropriate to this one i want to adress the first item of each row in this way).
Would be very thankful for help.
I.B.
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
Less
More
- Posts: 8743
12 years 1 week ago #103945
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: CSS class for the FIRST container of each row
Hi. You want to add a class in the first row or in every 4th row? Please be more specific so we can help you.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Iwial
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
12 years 1 week ago #103946
by Iwial
Replied by Iwial on topic Re: CSS class for the FIRST container of each row
Hi, i want to add a class to every first item in a row. So if i've got 4 columns and 3 rows i want to define a general CSS class for the items 1,5 and 9. Just as this code defines a class "CategoryContainerLast" for the last item of each row, i want to do this for the first item of each row as well, like "CategoryContainerFirst".
Hope this helped.
Thanks,
I.B.
Hope this helped.
Thanks,
I.B.
Please Log in or Create an account to join the conversation.
- Lefteris
- Offline
- Moderator
Less
More
- Posts: 8743
12 years 1 week ago #103947
by Lefteris
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Lefteris on topic Re: CSS class for the FIRST container of each row
There are no columns. You just have a number of items. If you want to add a class let's say every 4th item you can do something like that:
if( (($key+1)%4==0)
{
....
}
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Iwial
- Topic Author
- Offline
- New Member
Less
More
- Posts: 3
12 years 1 week ago #103948
by Iwial
Replied by Iwial on topic Re: CSS class for the FIRST container of each row
Thought there are columns since i can set in the Category Item Layout in the Backend "Columns for primary". Maybe I wrote it to complicated, but this doesn't really help me, sorry :(
I'll explain it as easy as possible with the Words of K2 itself:
This is what K2 says: "Define a CSS class for the last container on each row"
What I want to add: "Define a CSS class for the first container on each row".
Think that's very clear now :)
Thanks.
I'll explain it as easy as possible with the Words of K2 itself:
This is what K2 says: "Define a CSS class for the last container on each row"
What I want to add: "Define a CSS class for the first container on each row".
Think that's very clear now :)
Thanks.
Please Log in or Create an account to join the conversation.