- Posts: 404
COMMUNITY FORUM
Multiple Category Menu Item Layout order??
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
1. I have 3 Child categories selected. Neurology Staff, Specialty Staff, and Office Staff
2. I have "Order" selected for Item ordering (See attached)
3. The items are not in the "Order" of the "K2 Items" list. (See attached, "K2 Item Order")
4. The order on the page is all mixed up.
See attached screen shot for thebrainpro.com/test/index.php?option=com_k2&view=itemlist&layout=category&Itemid=426
How do I get this Menu Item "Our Staff" to order the Items in the same order as the attached "k2 item order" screen shot?
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
- Posts: 404
2. Am I doing something wrong or is this a problem with k2?
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
- Posts: 66
I just had to do a multi category menu page for a client, could not work out why items were displaying out of "order" sequence...(Other K2 sites I have built were sorted by Date, or order was unimportant)
I worked out that the items are displayed in order, but the Category plays no part in the ordering/display order so :
item A (order #1) Category X
item B (order #2) Category X
item C (order #1) Category Y
It would display item A, then item C, then item B (order is literal 1,1,2 ?)
Time constraints have lead me to this flexible/easy workaround....
To display "Combined Category X & Y"
Use Single Category Menu item,
Filter param set to Category X,
Download/Install Mod K2 Content (Tag Version)
In Mod K2 Content Module (params set to filter by category : Category Y,
Order set to : order,
and Display on Menu Item :"Combined Category X & Y")
Hope this helps ( I am using the Mod K2 Content (Tag Version) for more than this as it can be styled to suit the rest of the site.....)
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
- Posts: 404
I hope this discussion is viewed by the developers so that they can see it is an issue for more then just myself.
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
- Posts: 404
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
- Posts: 66
I have had a couple of hours to try a few things out to "fix" this...
It does involve one VERY small change in a CORE file - You must remember to re do this change if you update K2 to next version... (I did this myself during testing this "fix" today and wiped out a couple of other bits I was working on - I forgot to back up - Doh!)
Also I am sure there will be a better fix but this works for me (k2 v 2.4.1)
Fix ALL itemlist pages - order by Category, and then order by Item Ordering !) - Works on Tag pages too
Edit around line 235 in :
components/com_k2/models/itemlist.php
case 'order':
if (JRequest::getInt('featured') == '2')
$orderby = 'i.featured_ordering';
else
// $orderby = 'i.ordering';
// ORDER by i.catid or category Ordering then Item Ordering ? Edited by This email address is being protected from spambots. You need JavaScript enabled to view it.
$orderby = 'c.ordering,i.ordering';
I have tried this with c.catid which might also suit your project...
Also I tested the items also display in Category ordering - and in Item ordering so I made category params set to display Item Order by "order" too....
Please let me know if this helps - I am not a coder - I try to learn as I go, and want to give a little back to the K2 community.
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
- Posts: 404
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
- Posts: 66
Please Log in or Create an account to join the conversation.
- Simon Wells
-
- Offline
- Platinum Member
- Posts: 955
As explained to Jeff, my new K2 template demo uses multiple cats in a menu link, but I have not tested for this issue, but will.
I have submitted this post as a bug report and the fix may be included in a following beta release, if approved.
Thanks again.
Simon
K2 Support
Please Log in or Create an account to join the conversation.
- JoomlaWorks
-
- Offline
- Admin
- Posts: 6227
Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)
Please Log in or Create an account to join the conversation.
- Warrick Van Den Heever
-
- Offline
- New Member
- Posts: 15
Joomla has the same problem.
Please Log in or Create an account to join the conversation.
- Rishona Campbell
-
- Offline
- New Member
- Posts: 9
Please Log in or Create an account to join the conversation.
- Roger Edrinn
-
- Offline
- Senior Member
- Posts: 55
Please Log in or Create an account to join the conversation.
- Roger Edrinn
-
- Offline
- Senior Member
- Posts: 55
Where do I access the .php file (components/com_k2/models/itemlist.php)?
From the K2/Joomla Admin area?
From Cpanel, if so where?
Do I use a text editor or a special PHP editor?
mat said:
Edit around line 235 in : components/com_k2/models/itemlist.php
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
- Posts: 66
I use Notepad, and accesss the files using FTP. I will also repeat the obvious : Back Up the file you are editing first !!
Glad this "fix" has helped others, although I am not convinced it is a K2 bug, more of a work a round to get the desired effect....
Roger Edrinn said:
I want to try this fix but not sure where to start, some question:
Where do I access the .php file (components/com_k2/models/itemlist.php)?
From the K2/Joomla Admin area?
From Cpanel, if so where?
Do I use a text editor or a special PHP editor?
mat said:
Edit around line 235 in : components/com_k2/models/itemlist.php
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
- Posts: 404
Yes you can use the file manager section of cpanel to edit the php file. You do not need an additional program if you use cpanel as the editing is done inside your browser.
Roger Edrinn said:
I want to try this fix but not sure where to start, some question:
Where do I access the .php file (components/com_k2/models/itemlist.php)?
From the K2/Joomla Admin area?
From Cpanel, if so where?
Do I use a text editor or a special PHP editor?
mat said:
Edit around line 235 in : components/com_k2/models/itemlist.php
Please Log in or Create an account to join the conversation.
- Odin Mayland
-
Topic Author
- Offline
- Platinum Member
- Posts: 404
If this is not a bug, then how would you use the "Multiple Category Menu Item Layout" and not have it be in a totally random order? I assume there are uses for random layouts but I assume they are more rare.
mat said:
Hi Roger,
I use Notepad, and accesss the files using FTP. I will also repeat the obvious : Back Up the file you are editing first !!
Glad this "fix" has helped others, although I am not convinced it is a K2 bug, more of a work a round to get the desired effect....
Roger Edrinn said:
I want to try this fix but not sure where to start, some question:
Where do I access the .php file (components/com_k2/models/itemlist.php)?
From the K2/Joomla Admin area?
From Cpanel, if so where?
Do I use a text editor or a special PHP editor?
mat said:
Edit around line 235 in : components/com_k2/models/itemlist.php
Please Log in or Create an account to join the conversation.
- Roger Edrinn
-
- Offline
- Senior Member
- Posts: 55
Before you both posted and with a lot of stumbling, bumbling and Googling I was able to Filezilla (FTP) my into Cpanel and find the folder with itemlist.php, which I placed a copy on my HDD. I then opened itemlist.php in Vim which has a line counter, so finding line 235 was trivial. The edit was easy and I replaced the original with the edited copy.
Now the testing, later today. I'll report back success or failure, not totally sure this is THE answer to my problem. Here's hoping.
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
- Posts: 66
Not sure about Random, but the Date ordering has always been the ordering of choice for my clients - date ordering for News items, works well. But we needed things done in a more of a catalogue style of ordering.
In fact it seemed illogical to order it any other way, until the next client wanted it ordered by date again !!
Needs must etc etc.
modernmagic said:
Mat,
If this is not a bug, then how would you use the "Multiple Category Menu Item Layout" and not have it be in a totally random order? I assume there are uses for random layouts but I assume they are more rare.
mat said:
Hi Roger,
I use Notepad, and accesss the files using FTP. I will also repeat the obvious : Back Up the file you are editing first !!
Glad this "fix" has helped others, although I am not convinced it is a K2 bug, more of a work a round to get the desired effect....
Roger Edrinn said:
I want to try this fix but not sure where to start, some question:
Where do I access the .php file (components/com_k2/models/itemlist.php)?
From the K2/Joomla Admin area?
From Cpanel, if so where?
Do I use a text editor or a special PHP editor?
mat said:
Edit around line 235 in : components/com_k2/models/itemlist.php
Please Log in or Create an account to join the conversation.
- matthew turner
-
- Offline
- Senior Member
- Posts: 66
I think what would be better is a wider selection of display/ordering options for multi category pages:
Group by Category,
Group by Author,
Group by ExtraField etc,
And then apply the ordering (by date, or Ordering or even Random (why?)
Unfortunately I do not enough time to fix/create a better solution for this until a client needs it, but will post any further help if I can.
Please Log in or Create an account to join the conversation.