Keyword

Subcategory Ordering

  • gianpiero sfameni
  • gianpiero sfameni's Avatar Topic Author
  • Offline
  • New Member
More
15 years 7 months ago #72940 by gianpiero sfameni
Subcategory Ordering was created by gianpiero sfameni
Hi All, many thanks for this great component.

I don't know if this is a bug or my mystake, i cannot order items in a subcategory (without child category). Whatever options i chose for ordering items are displayed with the same order.

Everything work fine adding an empty category under the subcategory.

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72941 by Lefteris
Replied by Lefteris on topic Subcategory Ordering
Hi. If you choose to show featured items then the ordering defaults to "featured ordering".

Please Log in or Create an account to join the conversation.

  • gianpiero sfameni
  • gianpiero sfameni's Avatar Topic Author
  • Offline
  • New Member
More
15 years 7 months ago #72942 by gianpiero sfameni
Replied by gianpiero sfameni on topic Subcategory Ordering
thanks for your reply. no items marked as featured, featured option set to hide and the problem persists. My list show always items ordered by most hits.
Any other ideas?

Thanks!

Lefteris Kavadas said:Hi. If you choose to show featured items then the ordering defaults to "featured ordering".

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72943 by Lefteris
Replied by Lefteris on topic Subcategory Ordering
Hi. Try to clean the Joomla! cache and delete and recreate the menu item.

Gianpiero said:thanks for your reply. no items marked as featured, featured option set to hide and the problem persists. My list show always items ordered by most hits. Any other ideas?

Thanks!

Lefteris Kavadas said:Hi. If you choose to show featured items then the ordering defaults to "featured ordering".

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72944 by Justin Gonzalez
Replied by Justin Gonzalez on topic Subcategory Ordering
Hi there!

First off, I also thank you very much for this awesome component! I have run into this same bug - no item sorting control within a sub-category. I tried Lefteris Kavadas suggestion but to no avail have I been able to get this to work.

Now the only thing I haven't tried yet is actually clearing the Joomla! cache, deleting all of my items and then re-adding them. I am going to give that a try in the morning but if anyone has any other suggestions, or knows exactly what the problem is and how to fix it, that would be greatly appreciate!!

Much thanks again and keep up the awesome work!



j.

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72945 by Lefteris
Replied by Lefteris on topic Subcategory Ordering
Hi. If you are viewing items from multiple categories ( through a menu item ) then you have to set the ordering on the menu item settings. If you are viewing items from one category then you have to set this on the category edit page.

Please Log in or Create an account to join the conversation.

  • gianpiero sfameni
  • gianpiero sfameni's Avatar Topic Author
  • Offline
  • New Member
More
15 years 7 months ago #72946 by gianpiero sfameni
Replied by gianpiero sfameni on topic Subcategory Ordering
Thanks for your suggestions, I followed your instructions but unfortunately the bug is still on!
I'm accessing a single category from a menu pointing to a single category (Options for Ordering Etc.. are disabled!).

This is my actual configuration:

Category:
News
- Events

Menu:
News --> Point to News Category
- Event --> Point to Events Category

Going to Events, from menu or from the subcategory box (displayed in the upper of my page viewing News main category) items are displayed without ordering control.

The only work around i've found is to put an empty subcategory under those containing items.

In my case this work:

Category:
News
- Events
- Dummy Events

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72947 by Justin Gonzalez
Replied by Justin Gonzalez on topic Subcategory Ordering
Hello again,

So I checked what you said about the sorting options directly under the menu item linking to this sub-category with the sorting problems. >>>

Projects (K2 » Item / Item)
- Blah (K2 » Item / Item)
- Blah 2 (K2 » Item / Item)
- Blah 3 (K2 » Item / Item)
- Blah 4 (K2 » Item / Item)
- Blah 5 (K2 » Itemlist / Category) ****** PROBLEM SUB-CATEGORY ******


Now, I go into the menu item - Blah 5 (K2 » Itemlist / Category) - and look at the sorting options but they are deactivated (grayed out), so I can't modify them. I do see an option there that I think will fix this issue but it does not allow me to modify it.

Parameters inside this menu option (Blah 5 (K2 » Itemlist / Category)) -

Parameters (Basic) >

Projects
- Web Design (Selected Catagory)

Layout options for multiple category selection
*** ALL OPTIONS ARE GRAYED OUT, CANNOT EDIT ***


One other thing - if I go to my K2 Items, I can re-order them (with green arrows and then save button) but it doesn't actually change the order of the items on the front-end display.

Ideas??


Gianpiero said:Thanks for your suggestions, I followed your instructions but unfortunately the bug is still on! I'm accessing a single category from a menu pointing to a single category (Options for Ordering Etc.. are disabled!).
This is my actual configuration:

Category:
News
- Events

Menu:
News --> Point to News Category
- Event --> Point to Events Category

Going to Events, from menu or from the subcategory box (displayed in the upper of my page viewing News main category) items are displayed without ordering control.

The only work around i've found is to put an empty subcategory under those containing items.

In my case this work:

Category:
News
- Events
- Dummy Events

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72948 by Lefteris
Replied by Lefteris on topic Subcategory Ordering
Hi. The parameters on the menu item page are grayed out because you have select only one category. In this case K2 reads the parameters from the category edit page. If you choose more than one category on the menu item then the parameters are available there.

J Gonz said:Hello again,
So I checked what you said about the sorting options directly under the menu item linking to this sub-category with the sorting problems. >>>

Projects (K2 » Item / Item)
- Blah (K2 » Item / Item)
- Blah 2 (K2 » Item / Item)
- Blah 3 (K2 » Item / Item)
- Blah 4 (K2 » Item / Item)
- Blah 5 (K2 » Itemlist / Category) ****** PROBLEM SUB-CATEGORY ******


Now, I go into the menu item - Blah 5 (K2 » Itemlist / Category) - and look at the sorting options but they are deactivated (grayed out), so I can't modify them. I do see an option there that I think will fix this issue but it does not allow me to modify it.

Parameters inside this menu option (Blah 5 (K2 » Itemlist / Category)) -

Parameters (Basic) >

Projects
- Web Design (Selected Catagory)

Layout options for multiple category selection
*** ALL OPTIONS ARE GRAYED OUT, CANNOT EDIT ***


One other thing - if I go to my K2 Items, I can re-order them (with green arrows and then save button) but it doesn't actually change the order of the items on the front-end display.

Ideas??


Gianpiero said:Thanks for your suggestions, I followed your instructions but unfortunately the bug is still on! I'm accessing a single category from a menu pointing to a single category (Options for Ordering Etc.. are disabled!). This is my actual configuration:

Category:
News
- Events

Menu:
News --> Point to News Category
- Event --> Point to Events Category

Going to Events, from menu or from the subcategory box (displayed in the upper of my page viewing News main category) items are displayed without ordering control.

The only work around i've found is to put an empty subcategory under those containing items.

In my case this work:

Category:
News
- Events
- Dummy Events

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72949 by Justin Gonzalez
Replied by Justin Gonzalez on topic Subcategory Ordering
Gotcha.

I checked out the parameters in the category, which has settings for item ordering, but even after playing with those settings nothing has changed.

Any other ideas?

Lefteris Kavadas said:Hi. The parameters on the menu item page are grayed out because you have select only one category. In this case K2 reads the parameters from the category edit page. If you choose more than one category on the menu item then the parameters are available there.
J Gonz said:Hello again, So I checked what you said about the sorting options directly under the menu item linking to this sub-category with the sorting problems. >>>

Projects (K2 » Item / Item)
- Blah (K2 » Item / Item)
- Blah 2 (K2 » Item / Item)
- Blah 3 (K2 » Item / Item)
- Blah 4 (K2 » Item / Item)
- Blah 5 (K2 » Itemlist / Category) ****** PROBLEM SUB-CATEGORY ******


Now, I go into the menu item - Blah 5 (K2 » Itemlist / Category) - and look at the sorting options but they are deactivated (grayed out), so I can't modify them. I do see an option there that I think will fix this issue but it does not allow me to modify it.

Parameters inside this menu option (Blah 5 (K2 » Itemlist / Category)) -

Parameters (Basic) >

Projects
- Web Design (Selected Catagory)

Layout options for multiple category selection
*** ALL OPTIONS ARE GRAYED OUT, CANNOT EDIT ***


One other thing - if I go to my K2 Items, I can re-order them (with green arrows and then save button) but it doesn't actually change the order of the items on the front-end display.

Ideas??


Gianpiero said:Thanks for your suggestions, I followed your instructions but unfortunately the bug is still on! I'm accessing a single category from a menu pointing to a single category (Options for Ordering Etc.. are disabled!). This is my actual configuration:
Category:
News
- Events

Menu:
News --> Point to News Category
- Event --> Point to Events Category

Going to Events, from menu or from the subcategory box (displayed in the upper of my page viewing News main category) items are displayed without ordering control.

The only work around i've found is to put an empty subcategory under those containing items.

In my case this work:

Category:
News
- Events
- Dummy Events

Please Log in or Create an account to join the conversation.

  • Tomasz Bieliński
  • Tomasz Bieliński's Avatar
  • Offline
  • Senior Member
More
15 years 7 months ago #72950 by Tomasz Bieliński
Replied by Tomasz Bieliński on topic Subcategory Ordering
- I have link in the menu to items from multiple categories (more then one category) - I cant see "the category description field" in the front (image of the category)
- when I link through the page (image of root category) to the same items from the same muliply category - I can see the category image
- this is only for multiple categories, for one category is OK

Is this normal? I checked it with one category and one or more sub-categories.

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72951 by Lars
Replied by Lars on topic Subcategory Ordering
I had the same problem and have a workaround for it:

My intention is to display a list of news 'most recent first', which can be accessed through a menu entry. The articles are all in the category 'News'.

Article ordering can be set (and it works on my system) when setting on the menu entry of type K2 - Item listings - Categories.
Only problem I have, is, that at least two categories have to be chosen to be able to change the ordering drop down box.

To solve this, I created a second category 'News2' which contains no articles. In the menu entry I choose both categories. Therefore the ordering drop down gets accessible and I can choose 'Most recent first'.

The second (empty) category has no side effect for my configuration and everything runs fine.

Lars

Please Log in or Create an account to join the conversation.

  • gianpiero sfameni
  • gianpiero sfameni's Avatar Topic Author
  • Offline
  • New Member
More
15 years 7 months ago #72952 by gianpiero sfameni
Replied by gianpiero sfameni on topic Subcategory Ordering
Trying to clarify.

This is my scenario:

1) Create New K2 Category
Title= Category1
Parent category= Top
Inherit parameter options from category= None
Extra Fields= None
Other layout options
Catalog mode= No
Featured Items= Show
Item ordering = Most Recent First


2) Create New K2 Item
Title= item1
Category=Category1
Creation date=2009-09-30 08:38:36

3) Create New K2 Item
Title= item2
Category=Category1
Creation date=2009-09-30 08:40:46

4) Create New K2 Item
Title= item3
Category=Category1
Creation date=2009-09-30 08:45:06

5) Create New Menu Item
Menu item type= K2 -> Item Listing -> Categories
Title= category1
Select categories= Category1

6) Debug Mode ON

This is my query:
SELECT i.*, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams
FROM jos_k2_items AS i
LEFT JOIN jos_k2_categories AS c
ON c.id = i.catid
WHERE i.published = 1
AND i.access <= 0
AND i.trash = 0
AND c.published = 1
AND c.access <= 0
AND c.trash = 0
AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2009-09-30 08:49:01' )
AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2009-09-30 08:49:01' )
AND c.id IN (25)
GROUP BY i.id
ORDER BY i.created DESC
LIMIT 0, 14

This is the result:
id title alias catid published introtext fulltext video gallery extra_fields extra_fields_search created
110 item1 item1 25 1 NULL NULL [] 2009-09-30 08:38:36
111 item2 item2 25 1 NULL NULL [] 2009-09-30 08:40:46
112 item3 item3 25 1 NULL NULL [] 2009-09-30 08:45:06


Most Recent item in this list is item3 and it is in last position!

Workaround found for this issue:
1) Add a subcategory to category1
2) Select 2 categories from the options "Select categorie" in the Menu
In this 2 cases the query change from "AND c.id IN (25) to "AND c.id IN (24,25)" and everything work fine!
3)Removing Group By, LINE 183 in \components\com_k2\models\itemlist.php (//$query .= " GROUP BY i.id";)

Last solution work fine but i don't know the impact of this change in other functionality of K2.

Please Log in or Create an account to join the conversation.

  • Tomasz Bieliński
  • Tomasz Bieliński's Avatar
  • Offline
  • Senior Member
More
15 years 7 months ago #72953 by Tomasz Bieliński
Replied by Tomasz Bieliński on topic Subcategory Ordering
Lars said:I had the same problem and have a workaround for it:
My intention is to display a list of news 'most recent first', which can be accessed through a menu entry. The articles are all in the category 'News'.

Article ordering can be set (and it works on my system) when setting on the menu entry of type K2 - Item listings - Categories.
Only problem I have, is, that at least two categories have to be chosen to be able to change the ordering drop down box.

To solve this, I created a second category 'News2' which contains no articles. In the menu entry I choose both categories. Therefore the ordering drop down gets accessible and I can choose 'Most recent first'.

The second (empty) category has no side effect for my configuration and everything runs fine.

Lars


I have done like you. Do you have "category description" field visible in such configuration (with linking from the menu)? I cant activate it from menu link only from page...

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72954 by Lars
Replied by Lars on topic Subcategory Ordering
I have the category description turned off.
I could imagine that it is not possible to turn it on in the menu in this constellation, because the system would not know, which categories' description to display.

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72955 by Lars
Replied by Lars on topic Subcategory Ordering
@Gianpiero, I don't know what this query generator code is used for, else.
I would mainly check for scenarios, where the number of articles in a category is calculated and displayed.

Please Log in or Create an account to join the conversation.

  • Tomasz Bieliński
  • Tomasz Bieliński's Avatar
  • Offline
  • Senior Member
More
15 years 7 months ago #72956 by Tomasz Bieliński
Replied by Tomasz Bieliński on topic Subcategory Ordering
Lars said:I have the category description turned off. I could imagine that it is not possible to turn it on in the menu in this constellation, because the system would not know, which categories' description to display.

Don't worry about the system, it knows :-). To show you what I mean check the attached files. As you see in "menu_view.jpg" K2 don't display category description, but when the same category is called from page (not from menu) you see the description (page_viw.jpg).
By the way: I can set one category A and sub categories 1,2, description can be in category A and link from the menu to category A with subcategories - I think it is OK to the system :-)
Attachments:

Please Log in or Create an account to join the conversation.

More
15 years 7 months ago #72957 by Lefteris
Replied by Lefteris on topic Subcategory Ordering
Hi. So the ordering setting from the category edit page doesn't work for you. I 'm trying to reproduce the bug but no luck yet. Are you sure you are using the latest version of K2? Also try to turn off the cache and see what happens. By the way the query K2 produces seems to be correct.

Gianpiero said:Trying to clarify. This is my scenario:

1) Create New K2 Category
Title= Category1
Parent category= Top
Inherit parameter options from category= None
Extra Fields= None
Other layout options
Catalog mode= No
Featured Items= Show
Item ordering = Most Recent First


2) Create New K2 Item
Title= item1
Category=Category1
Creation date=2009-09-30 08:38:36

3) Create New K2 Item
Title= item2
Category=Category1
Creation date=2009-09-30 08:40:46

4) Create New K2 Item
Title= item3
Category=Category1
Creation date=2009-09-30 08:45:06

5) Create New Menu Item
Menu item type= K2 -> Item Listing -> Categories
Title= category1
Select categories= Category1

6) Debug Mode ON

This is my query:
SELECT i.*, c.name AS categoryname,c.id AS categoryid, c.alias AS categoryalias, c.params AS categoryparams
FROM jos_k2_items AS i
LEFT JOIN jos_k2_categories AS c
ON c.id = i.catid
WHERE i.published = 1
AND i.access <= 0
AND i.trash = 0
AND c.published = 1
AND c.access <= 0
AND c.trash = 0
AND ( i.publish_up = '0000-00-00 00:00:00' OR i.publish_up <= '2009-09-30 08:49:01' )
AND ( i.publish_down = '0000-00-00 00:00:00' OR i.publish_down >= '2009-09-30 08:49:01' )
AND c.id IN (25)
GROUP BY i.id
ORDER BY i.created DESC
LIMIT 0, 14

This is the result:
id title alias catid published introtext fulltext video gallery extra_fields extra_fields_search created
110 item1 item1 25 1 NULL NULL [] 2009-09-30 08:38:36
111 item2 item2 25 1 NULL NULL [] 2009-09-30 08:40:46
112 item3 item3 25 1 NULL NULL [] 2009-09-30 08:45:06


Most Recent item in this list is item3 and it is in last position!

Workaround found for this issue:
1) Add a subcategory to category1
2) Select 2 categories from the options "Select categorie" in the Menu
In this 2 cases the query change from "AND c.id IN (25) to "AND c.id IN (24,25)" and everything work fine!
3)Removing Group By, LINE 183 in \components\com_k2\models\itemlist.php (//$query .= " GROUP BY i.id";)

Last solution work fine but i don't know the impact of this change in other functionality of K2.

Please Log in or Create an account to join the conversation.

  • gianpiero sfameni
  • gianpiero sfameni's Avatar Topic Author
  • Offline
  • New Member
More
15 years 7 months ago #72958 by gianpiero sfameni
Replied by gianpiero sfameni on topic Subcategory Ordering
My be a MYSQL issue? character set.... collation?? Running the same query on phpmyadmin the result is the same..... it work only by putting 2 categories on the HAVING clause or by removing GROUP BY.
Thanks.

Lefteris Kavadas said:By the way the query K2 produces seems to be correct.

Please Log in or Create an account to join the conversation.

More
15 years 6 months ago #72959 by Lefteris
Replied by Lefteris on topic Subcategory Ordering
Hi. Can you please post some info about your MySQL ( version, collation etc ) ? Also if it is possible try to attach an sql export of these K2 tables.

Please Log in or Create an account to join the conversation.


Powered by Kunena Forum