Keyword

Re: Item Ordering with numbered titles?

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
12 years 2 months ago - 12 years 2 months ago #103471 by Odin Mayland
Item Ordering with numbered titles? was created by Odin Mayland
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
12 years 2 months ago #103472 by Odin Mayland
Replied by Odin Mayland on 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
12 years 2 months ago #103473 by Lefteris
Replied by Lefteris on topic Re: Item Ordering with numbered titles?
Hi. You need to hack the SQL query to acieve this.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
12 years 2 months ago #103474 by Odin Mayland
Replied by Odin Mayland on 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
12 years 2 months ago #103475 by Lefteris
Replied by Lefteris on 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.

JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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

  • Odin Mayland
  • Odin Mayland's Avatar Topic Author
  • Offline
  • Platinum Member
More
12 years 1 month ago #103476 by Odin Mayland
Replied by Odin Mayland on 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 years 7 months ago #171606 by Odin Mayland
Replied by Odin Mayland on 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.

More
5 years 7 months ago #171613 by JoomlaWorks
Replied by JoomlaWorks on 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.).

Fotis / JoomlaWorks Support Team
---
Please search the forum before posting a new topic :)

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


Powered by Kunena Forum