Keyword

Re: Item Ordering with numbered titles?

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
6 years 11 months ago - 6 years 11 months ago #103471 by Odin Mayland
Odin Mayland created the topic: Item Ordering with numbered titles?
The items are titled and displayed in this alphabetical order:
9x6x18"
9x6x6"

I assume this is because the "1" in "18" is less the the "6" in the 2nd item.

I need them to be in order numerically. So 6" is less than 18".
It needs to be in this order:
9x6x6"
9x6x18"


There are hundreds of items with these numeric titles so manual ordering is not the preferred method.
How do I get this to work?

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
6 years 11 months ago #103472 by Odin Mayland
Odin Mayland replied the topic: Re: Item Ordering with numbered titles?
I assume this is the typical number ordering issue.
It should be 1,2,3,4,5,6,7,8,9,10,11

But k2 is putting it in 1,10,11,2,3,4,5,6,7,8,9

The items are searchable by their exact numeric title so I can NOT put a "0" in front of the first 9 numbers.

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

More
6 years 11 months ago #103473 by Lefteris
Lefteris replied the topic: Re: Item Ordering with numbered titles?
Hi. You need to hack the SQL query to acieve this.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
6 years 11 months ago #103474 by Odin Mayland
Odin Mayland replied the topic: Re: Item Ordering with numbered titles?
Ok. How do I do that?

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

More
6 years 11 months ago #103475 by Lefteris
Lefteris replied the topic: Re: Item Ordering with numbered titles?
It's not that easy, you need to know SQL. The title field is a character field and the sorting is performed alphabetically, not by value. You need to cast the title to an integer value in your query and then sort by this. You can also make a Google search for "MySQL natural sorting" to see what are the workarounds.

IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

---
JoomlaWorks
www.joomlaworks.net/

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
6 years 11 months ago #103476 by Odin Mayland
Odin Mayland replied the topic: Re: Item Ordering with numbered titles?
I have researched and this is over my head.

Is there a feature request system for having another sorting option for "natural sorting"?

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
5 months 3 weeks ago #171606 by Odin Mayland
Odin Mayland replied the topic: Re: Item Ordering with numbered titles?
Sorry its been so long but this problem has reared its head again because the search module does not like my k2 item title solution.

Anyways, is it possible to add an "Item Ordering" by "Title Alias - alphabetical" in the "Category item layout"?

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

  • Fotis
  • Fotis's Avatar
  • Online
  • Administrator
  • JoomlaWorks Support Team
More
5 months 3 weeks ago #171613 by Fotis
Fotis replied the topic: Re: Item Ordering with numbered titles?
If the title alias is not manually modified, then it's created from the title, in which case sorting alphabetically should be sufficient. If your aliases are totally different to the item title, there is no easy way (you'll have to hack core files). I can get you the solution but you need to tell me the exact places you'll need sorting (component, modules etc.).

If you use & love K2, please take a moment to add your review and rate it
at the Joomla Extensions Directory: extensions.joomla.org/extension/k2/


IMPORTANT: Please search the forum before posting a question!

JoomlaWorks Support Team Member

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

Moderators: william white

Powered by Kunena Forum