Topic on Extension talk:CategoryTree

Sorting articles in category - numbers

5
Monic abc (talkcontribs)

Is there any option to sort articles' names in such order as below?

I have now:

  xxx 1 yy
xxx 10 yy
xxx 11 yy
xxx 2 yy
xxx 20 yy
xxx 3 yy

And I want this:

  xxx 1 yy
xxx 2 yy
xxx 3 yy
xxx 10 yy
xxx 11 yy
xxx 20 yy
Dennis J au (talkcontribs)
Monic abc (talkcontribs)

Yes, but I don't know how to use these tips. I tried do sth like this:

    {{#categorytree:Levels|mode=pages|Sort}}

but it doesn't really works - nothing has changed. ("Levels" is my category with articles)

Dennis J au (talkcontribs)

I'm not a programmer, but when you add your articles to your "Levels" category you do it by adding something like this...

[[Category:Levels]]

... to your article page.

If your article needs to be at the top of the sort list, e.g. for 'xxx 1 yy' do this

 [[Category:Levels|1]]

The '1' after the pipe character '|' is a 'sort key' which will bring the article with that key to the top of the sort.

For the rest of the articles in your example, just make the sort key equal to the number of the article, like this

For article 'xxx 10 yy' make the sort key '10' by adding the following to that article's page...

 [[Category:Levels|10]]

For article 'xxx 11 yy' add this...

[[Category:Levels|11]]

for 'xxx 2 yy' add this...

 [[Category:Levels|2]]

for 'xxx 20 yy' add this...

 [[Category:Levels|20]]

for 'xxx 3 yy' add this...

 [[Category:Levels|3]]

...etc.

Try that and see how it goes.

Monic abc (talkcontribs)

Thanks a lot! I thought that I have to edit some options in line with CategoryTree, not article's category. What works for me:

  [[Category:Levels|[10]]

Number without brackets didn't work, so I used this "[number]".

Reply to "Sorting articles in category - numbers"