- Posts: 84
COMMUNITY FORUM
Sub category display
- Marty Peet
-
Topic Author
- Offline
- Premium Member
I have a couple of questions, can anyone tell me why there is such a large gap between the sub-category descriptions? If you scroll down so that you can see all the white space and hit the refresh button you can see the content initially quite close to the content above it. I think the CSS kicks it and pushes it way down, anyone know why?
Second question is, anyone have any idea where I can grab the code (for each probably) that would list ALL the items in each sub-category on this one page? This is a CUSTOMER request, I've tried to talk them out of it to no avail... even if they have 100's of items in 100's of sub-categories they want them displayed
Third question, is there any reason anyone can think of why my templates DON'T implement or use the item.php file that is part of my template? It DEFINITELY uses the category.php and category_item.php files, but not the item.php. For that it loads the item.php from the k2 folder. I've noticed a php section 'Load category_item.php by default' Could the same strategy be used to load the item.php file that I require?
Thanks for any/all help provided
Please Log in or Create an account to join the conversation.
- renegadesk
-
- Offline
- New Member
- Posts: 9
Question 2: You don't need code to list all the items on this page, as this is configurable through K2.
- Go to the top level category for this page in K2 i.e. Programs.
- To display all items in sub cats, the Parameter section you will need to look at is "Category item layout"
- Under "layout grid" make sure there is at least a number higher then 0 for "leading count"
- Under "Other layout options" make sure "Catalog mode" is set to "No".
That should do the job for you. I will admit that I am fairly new to K2 but I have got my head around it pretty quick and this is the parameter options that I altered to do what you are trying to achieve. They may be another config option somewhere that may affect how it is displaying on your site so post back if my idea doesn't work and I'll look around a bit more.
Question 3: Can't help with this as I haven't looked into the custom K2 templates as yet. Will post back if I come up with a solution for you. Oh and now that I think of it, maybe your custom template is affecting the display in your Question 2.
Good luck.
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- juro
-
- Offline
- Senior Member
- Posts: 42
I failed up to now.
Marty Peet said:Well, that was rather interesting. Turned off catalog mode and added leading of 1. The page now has, from the top down, a description of my top level category, next descriptions of ALL secondary level categories STILL with large white spaces between them, and then at the bottom of the page individual items (item view in category view) What I'd like is to have each of the items listed underneath it's particular category introduction and no white space... probably have to start moving sections of code?
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- renegadesk
-
- Offline
- New Member
- Posts: 9
... OK I've figured it out. It's to do with your description text for the categories. K2 will load all the categories, look for the category with the biggest height, then append that same height to all of the category divs regardless of how much content they have. I assume this is so that if your category div has a border or background colour, then all the category divs would display the same height to look nice. Doesn't look so nice on your site at the moment though!
Reduce the description text or add a "read more" tag on your categories and you'll fix one of your problems.
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- Elisa F.
-
- Offline
- Junior Member
- Posts: 32
.clr {clear:both;height:0;line-height:0;display:block;float:none;}
.clearList {display:none;}
so the .clr container is not displayed
Greetings
Elisa
Please Log in or Create an account to join the conversation.
- Steve Adams
-
- Offline
- New Member
- Posts: 7
Did you make any progress with sub-category item titles? This seems to be a common mod request, not sure why it was omitted from K2 sub-category parameters when it is default in vanilla joomla. Also, are you sure components/com_k2/views/view.html.php exists in K2.2?
Thanks
Roland Jungwirth said:I have the same problem ... Just moving code isn't enough though, in components/com_k2/views/view.html.php, in the foreach loop on line 96, you'll have to populate the subcategory array item.
I failed up to now.
Marty Peet said:Well, that was rather interesting. Turned off catalog mode and added leading of 1. The page now has, from the top down, a description of my top level category, next descriptions of ALL secondary level categories STILL with large white spaces between them, and then at the bottom of the page individual items (item view in category view) What I'd like is to have each of the items listed underneath it's particular category introduction and no white space... probably have to start moving sections of code?
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- Elisa F.
-
- Offline
- Junior Member
- Posts: 32
Marty Peet said:Hey Elisa, this appears to be the CSS that is already in the k2.css file?
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- MC
-
- Offline
- New Member
- Posts: 1
I had this problem a while back while bug fixing for a client and was scratching my head how to solve it. When viewing in Firebug the style height appended to the div was there but when viewing source it wasn't so thought it must be a javascript thing.
This is a core hack so not the best way, but here goes...
1. Go to /components/com_k2/js/k2.js
2. Around line 90 there is a load function, all you need to do is comment out the whole thing (code below)
3. Job done!
//window.addEvent('load', function(){
// Equal block heights for the "default" view
// if($$('.subCategory')){
// var blocks = $$('.subCategory');
// var maxHeight = 0;
// blocks.each(function(item){
// maxHeight = Math.max(maxHeight, parseInt(item.getStyle('height')));
// });
// blocks.setStyle('height', maxHeight);
// }
// });
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
Please Log in or Create an account to join the conversation.
- Taylor Warnick
-
- Offline
- New Member
- Posts: 3
MC said:Solved!
I had this problem a while back while bug fixing for a client and was scratching my head how to solve it. When viewing in Firebug the style height appended to the div was there but when viewing source it wasn't so thought it must be a javascript thing.
This is a core hack so not the best way, but here goes...
1. Go to /components/com_k2/js/k2.js
2. Around line 90 there is a load function, all you need to do is comment out the whole thing (code below)
3. Job done!
//window.addEvent('load', function(){
// Equal block heights for the "default" view
// if($$('.subCategory')){
// var blocks = $$('.subCategory');
// var maxHeight = 0;
// blocks.each(function(item){
// maxHeight = Math.max(maxHeight, parseInt(item.getStyle('height')));
// });
// blocks.setStyle('height', maxHeight);
// }
// });
Please Log in or Create an account to join the conversation.
- Justin Herrin
-
- Offline
- Junior Member
What I have displays my page like this...
Page Title - Parent Category title
- Subcategory 1 title
-- Subcategory 1 Item 1
-- Subcategory 1 Item 2
-- Subcategory 2 Item 1
-- Subcategory 2 Item 2
- Subcategory 2 title
-- Subcategory 1 Item 1
-- Subcategory 1 Item 2
-- Subcategory 2 Item 1
-- Subcategory 2 Item 2
As you can see, ALL items are showing under each subcategory, instead of just that specific subcategory's items. A bit frustrating so say the least.
Please Log in or Create an account to join the conversation.
- Marty Peet
-
Topic Author
- Offline
- Premium Member
- Posts: 84
new.template.s50284.gridserver.com/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=5&Itemid=4
Click on the Browse Experts tab, click on the slide titles. The titles are individual categories within the parent category Experts, each item in those sub-category is listed.
Please Log in or Create an account to join the conversation.