- Posts: 7
COMMUNITY FORUM
- Forum
- K2 Community Forum
- English K2 Community
- How to create categories list with image and description?
How to create categories list with image and description?
- Panagiotis
-
Topic Author
- Offline
- New Member
Less
More
8 years 7 months ago - 8 years 7 months ago #157944
by Panagiotis
How to create categories list with image and description? was created by Panagiotis
Last edit: 8 years 7 months ago by Panagiotis.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 7 months ago #157973
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic How to create categories list with image and description?
Hello,
If these are subcategories, you can use the subcategories block to display this data. Eg: demo.nuevvo.com/sites/j3x/takai/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=14&Itemid=158
Otherwise you can use the latest items from categories menu item, and not display any items.
If these are subcategories, you can use the subcategories block to display this data. Eg: demo.nuevvo.com/sites/j3x/takai/index.php?option=com_k2&view=itemlist&layout=category&task=category&id=14&Itemid=158
Otherwise you can use the latest items from categories menu item, and not display any items.
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Panagiotis
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 7
8 years 6 months ago - 8 years 6 months ago #158685
by Panagiotis
Replied by Panagiotis on topic How to create categories list with image and description?
I 'm replying with some delay, sorry for this.
I try to make a Menu Item with Menu Item Type = Categories (K2 Categories).
In the menu item 's Options, in 'Select categories', I put a category and saved it.
But when I click on the menu item in my site, an error (actually a notice) occurs:
Line 651 is this:
Using:I get: null.
For some reason line 640:returns null.
My menu item is the default item of the menu, it is the home.
I try to make a Menu Item with Menu Item Type = Categories (K2 Categories).
In the menu item 's Options, in 'Select categories', I put a category and saved it.
But when I click on the menu item in my site, an error (actually a notice) occurs:
Notice: Trying to get property of non-object in ....\components\com_k2\views\itemlist\view.html.php on line 651
Line 651 is this:
if (!is_null($active) && $active->id == $default->id && $sef)
Using:
var_dump($default)
For some reason line 640:
$default = $menu->getDefault();
My menu item is the default item of the menu, it is the home.
Last edit: 8 years 6 months ago by Panagiotis.
Please Log in or Create an account to join the conversation.
- Krikor Boghossian
-
- Offline
- Platinum Member
Less
More
- Posts: 15920
8 years 6 months ago #158694
by Krikor Boghossian
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Replied by Krikor Boghossian on topic How to create categories list with image and description?
Which version of K2 are you using?
JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Panagiotis
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 7
8 years 6 months ago - 8 years 6 months ago #158695
by Panagiotis
Replied by Panagiotis on topic How to create categories list with image and description?
I use 2.7.1 (K2_v2.7.1.zip) (on Joomla 3.6.2).
Last edit: 8 years 6 months ago by Panagiotis.
Please Log in or Create an account to join the conversation.
- Panagiotis
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 7
8 years 6 months ago - 8 years 6 months ago #158697
by Panagiotis
Replied by Panagiotis on topic How to create categories list with image and description?
I also found out something not so..pleasant.
K2 catalogue can show only one K2 category.
I have 2 main categories, Products and Services.
I have put for both of them at Display settings->Other layout options->Catalogue mode=true.
Each of them has subcategories:
Products:
--Carpets
--Flooring
--Furniture
Services:
--Custom made
--Cleaning
1. In my Menu item 'Home': in Options->Select categories I put 'Products' .
My Home 's menu item's url: option=com_k2&view=itemlist&layout=category&task=category&id=20
Works ok, (except the above mentioned Notice), shows:
Carpets
Flooring
Furniture
2. In my Menu item 'Home': in Options->Select categories I put 2 categories, Products and Services.
My Home 's menu item's url: option=com_k2&view=itemlist&layout=category&task=&Itemid...
Doesn't look good to me, the link has no task and no category id while I have selected 2 categories.
And of course the result is as expected, no category is shown...
The result is an empty page.
K2 catalogue can show only one K2 category.
I have 2 main categories, Products and Services.
I have put for both of them at Display settings->Other layout options->Catalogue mode=true.
Each of them has subcategories:
Products:
--Carpets
--Flooring
--Furniture
Services:
--Custom made
--Cleaning
1. In my Menu item 'Home': in Options->Select categories I put 'Products' .
My Home 's menu item's url: option=com_k2&view=itemlist&layout=category&task=category&id=20
Works ok, (except the above mentioned Notice), shows:
Carpets
Flooring
Furniture
2. In my Menu item 'Home': in Options->Select categories I put 2 categories, Products and Services.
My Home 's menu item's url: option=com_k2&view=itemlist&layout=category&task=&Itemid...
Doesn't look good to me, the link has no task and no category id while I have selected 2 categories.
And of course the result is as expected, no category is shown...
The result is an empty page.
Last edit: 8 years 6 months ago by Panagiotis.
Please Log in or Create an account to join the conversation.
- Panagiotis
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 7
8 years 6 months ago - 8 years 6 months ago #158715
by Panagiotis
Replied by Panagiotis on topic How to create categories list with image and description?
In {site path}\components\com_k2\views\itemlist\view.html.php, line 34:
From what I understand, id can't be an array, it can only be an integer.
So a menu item can't really point towards multiple K2 categories (in Menu Item 's Options->Select Categories).
It can only point to one.
Am I right?
// Get data depending on task
switch ($task)
{
case 'category' :
// Get category
$id = JRequest::getInt('id');
From what I understand, id can't be an array, it can only be an integer.
So a menu item can't really point towards multiple K2 categories (in Menu Item 's Options->Select Categories).
It can only point to one.
Am I right?
Last edit: 8 years 6 months ago by Panagiotis.
Please Log in or Create an account to join the conversation.
- Panagiotis
-
Topic Author
- Offline
- New Member
Less
More
- Posts: 7
8 years 6 months ago - 8 years 6 months ago #158724
by Panagiotis
Replied by Panagiotis on topic How to create categories list with image and description?
In file {site}\components\com_k2\views\itemlist\view.html.php,
I changed lines 640 & 641 from:...to:...and the Notice (mentioned in #158685) is gone...
I changed lines 640 & 641 from:
$default = $menu->getDefault();
$active = $menu->getActive();
$active = $menu->getActive();
$default = $menu->getDefault($active->language);
Last edit: 8 years 6 months ago by Panagiotis.
Please Log in or Create an account to join the conversation.
- Forum
- K2 Community Forum
- English K2 Community
- How to create categories list with image and description?