Keyword

Multiple Category Menu Item Layout order??

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 4 months ago #91250 by Odin Mayland
Multiple Category Menu Item Layout order?? was created by Odin Mayland
I can not get the items to be ordered per the "K2 Items" list when I select multiple categories for a Category Menu Item.

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?
Attachments:

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 4 months ago #91251 by Odin Mayland
Replied by Odin Mayland on topic Multiple Category Menu Item Layout order??
1. Is there anything else I can do to explain this issue?
2. Am I doing something wrong or is this a problem with k2?

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

More
14 years 4 months ago #91252 by matthew turner
Replied by matthew turner on topic Multiple Category Menu Item Layout order??
Hi,
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
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 4 months ago #91253 by Odin Mayland
Replied by Odin Mayland on topic Multiple Category Menu Item Layout order??
I will try and mimic your workaround for now.

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
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 4 months ago #91254 by Odin Mayland
Replied by Odin Mayland on topic Multiple Category Menu Item Layout order??
BUG?: Unless someone posts an answer, I have to assume this is a bug or other design problem that needs to be resolved.

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

More
14 years 4 months ago #91255 by matthew turner
Replied by matthew turner on topic Multiple Category Menu Item Layout order??
Hi,
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
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 4 months ago #91256 by Odin Mayland
Replied by Odin Mayland on topic Multiple Category Menu Item Layout order??
PERFECT! your new code fixed it! I hope one of the developers see this and fix this bug in the next release after 2.4.1

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

More
14 years 4 months ago #91257 by matthew turner
Replied by matthew turner on topic Multiple Category Menu Item Layout order??
Glad it worked for you too!

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

More
14 years 4 months ago #91258 by Simon Wells
Replied by Simon Wells on topic Multiple Category Menu Item Layout order??
Thanks Jeff for taking the time to let me know about this and thanks to Mat for a fix.

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.

More
14 years 4 months ago #91259 by JoomlaWorks
Replied by JoomlaWorks on topic Multiple Category Menu Item Layout order??
We've noted this as a possible bug to investigate. Thanks for mentioning about it.

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
  • Warrick Van Den Heever's Avatar
  • Offline
  • New Member
More
14 years 4 months ago #91260 by Warrick Van Den Heever
Replied by Warrick Van Den Heever on topic Multiple Category Menu Item Layout order??
Thanks Mat! Such a simple fix!

Joomla has the same problem.

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

More
14 years 3 months ago #91261 by Rishona Campbell
Replied by Rishona Campbell on topic Multiple Category Menu Item Layout order??
This fix worked for me as well; thanks so much for sharing it!

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

More
14 years 3 months ago #91262 by Roger Edrinn
Replied by Roger Edrinn on topic Multiple Category Menu Item Layout order??
This may be my solution too. I'm posting now to save this thread.

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

More
14 years 3 months ago #91263 by Roger Edrinn
Replied by Roger Edrinn on topic Multiple Category Menu Item Layout order??
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.

More
14 years 3 months ago #91264 by matthew turner
Replied by matthew turner on topic Multiple Category Menu Item Layout order??
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.

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 3 months ago #91265 by Odin Mayland
Replied by Odin Mayland on topic Multiple Category Menu Item Layout order??
Roger,

 

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
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
14 years 3 months ago #91266 by Odin Mayland
Replied by Odin Mayland on topic Multiple Category Menu Item Layout order??
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.

More
14 years 3 months ago #91267 by Roger Edrinn
Replied by Roger Edrinn on topic Multiple Category Menu Item Layout order??
Thanks Mat & Modernmagic,

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.

More
14 years 3 months ago #91268 by matthew turner
Replied by matthew turner on topic Multiple Category Menu Item Layout order??
Hi,

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.

More
14 years 3 months ago #91269 by matthew turner
Replied by matthew turner on topic Multiple Category Menu Item Layout order??
Hi,

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.


Powered by Kunena Forum