Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Does 0 come before 1 when ordering the menu?
#1
Alright, I’m recoding my menu plugin—partly from scratch. One of the things I’m going to put time on is the menu sorting, I even have an admin interface planned so you can tell it how to sort. There is one thing that bugs me though, so I want to put it up for discussion here;

When defining a page’s priority it will show a default of -. Let’s call this “undefined”. The standard index page has a priority of 1, so it has a “defined” priority. If you now want your pages to show below the home page you need to define their priority to be 1 or bigger, logically, making their value “defined” as well.

In default sorting, any “undefined” page will come before any “defined” page. Does this sound right to you?

It doesn’t to me, but if you all think this is logical I’ll leave it untouched. The - is put before the others because it is saved by the core as a 0.
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#2
i see what you are saying - and i agree. any page that is not in a priority order should be placed at the end of the nav.
- Chris
Thanks for using GetSimple! - Download

Please do not email me directly for help regarding GetSimple. Please post all your questions/problems in the forum!
Reply
#3
Currently, my menu plugin is able to toggle between both ways. Should the core navigation function be changed or not? It might upset a lot of people…
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply
#4
Numbering should start at 1. This isn't the same for the php language, however, when you count form 1-10 you don't start with 0.

Also, maybe you could think about this for subpages...
1 -page
2 -page
3 -page
3.1 -subpage
3.2 -subpage
3.2.1 -subsubpage
3.2.2 -subsubpage
3.3 -subpage
4 -page
Clients always want to be able to change the content of their pages, but they are unwilling to do so.

Have you ever coded in your underwear before?
Reply
#5
It was already sorting sub pages that way.

The sorting process used to be something like this:
  • Compare menuOrder: lowest number first, starting with 0.
  • If the menuOrders were the same, compare menu textx (use titles if it is missing).
  • If the menu texts were the same, compare slugs (these are never the same.)
The new version of my plugin however looks at the first step like this:
  • Compare menuOrder: lowest number first, if one is over 0 and the other one equals 0 the latter comes later.
And this same process runs first on the top level and then on every sub level.

I hope custom menu sorting is going to make everyone happy when I launch it Smile
“Don’t forget the important ˚ (not °) on the a,” says the Unicode lover.
Help us test a key change for the core! ¶ Problems with GetSimple? Be sure to enable debug mode!
Reply




Users browsing this thread: 1 Guest(s)