- Posts: 44
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- customize the display of items k2 of certain categories
customize the display of items k2 of certain categories
- Alaabouch
-
Topic Author
- Offline
- Senior Member
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
In the category_item.php file you can perform a simple check like this:
<?php if($item->categoryname == 'CATEGORY_NAME'):
#code here
endif; ?>
Where you can echo some CSS class which differentiate the layout.
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
thank you for attention, I've followed the instructions cited in this connection and is the result :
www.aidepharmacien.ma/allergologie/antihistaminiques-h1
but what I do not understand is that I did call that 4 additional fields! why others are displayed ?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
can you give me a hand please. I remove the extra fields to the title but I know not how to apply float right to te class ?
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Here, I just do it! but it's ugly as design. is it possible to integrate them in a table ?
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
Here, I just do it! but it's ugly as design. is it possible to integrate them in a table ?
www.aidepharmacien.ma/antalgiques/antalgiques-non-opioides
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
I have made the change, but I would incorporate the content in a table. is it possible ?
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
honestly I could not do anything !
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
in this code
/* extrafields columns */
.extrafieldscolumns ul { width: 100%; margin:0;padding:0;/* CSS Reset */ max-width: 1000px; /* restrict the width */ margin: 0 40px; /* center it */}.extrafieldscolumns li { width: 20%; float:center; /* IMPORTANT */ list-style-type: none; display:inline; /* IMPORTANT */}
/* END extrafields columns */
div.catItemView.groupLeading{float:left;}
div.extrafieldscolumns{float: left;}
I don't know how do I adjust this code for additional fields align vertically ?
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
in this code
/* extrafields columns */
.extrafieldscolumns ul { width: 100%; margin:0;padding:0;/* CSS Reset */ max-width: 1000px; /* restrict the width */ margin: 0 40px; /* center it */}.extrafieldscolumns li { width: 20%; float:center; /* IMPORTANT */ list-style-type: none; display:inline; /* IMPORTANT */}
/* END extrafields columns */
div.catItemView.groupLeading{float:left;}
div.extrafieldscolumns{float: left;}
I don't know how do I adjust this code for additional fields align vertically ?
Please Log in or Create an account to join the conversation.
- Alaabouch
-
Topic Author
- Offline
- Senior Member
- Posts: 44
there was someone who had me help solve this problem partially. I replace the preceding code with this code in the file override.css
.itemContainer {
display: block;
}
.catItemView {
width: 30%;
}
.extrafieldscolumns ul {
margin: 0;
max-width: none;
padding: 0;
width: 100%;
}
.extrafieldscolumns li {
display: inline-block;
width: 20%;
text-align: right;
}
.extrafieldscolumns li:first-child {
width: 20%;
text-align: left;
}
.extrafieldscolumns li:nth-child(2) {
width: 30%;
}
.extrafieldscolumns li:nth-child(3) {
width: 20%;
}
.extrafieldscolumns li:nth-child(4) {
width: 10%;
}
but the change has been applied in all pages :(
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
- Posts: 15920
Now, you can create a K2 sub-template and add a class to the wrapper which is specific to that view.
Then your CSS should look like:
YourWrapperClass .itemContainer {
display: block;
}
YourWrapperClass .catItemView {
width: 30%;
}
.YourWrapperClass .extrafieldscolumns ul
...
More info can be found here: www.joomlaworks.net/blog/item/194-k2-inheritance-sub-templating
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- customize the display of items k2 of certain categories