In Categories management, there is a "order alphanumerically" button, but it only takes care of the categories name. I wish I could have a similar button for the directories names which are my main categories that I'm used to rename.
**Reported by Eric B on 11 Jun 2006 21:55**
**Version:** 1.6.0RC2
In Categories management, there is a "order alphanumerically" button, but it only takes care of the categories name. I wish I could have a similar button for the directories names which are my main categories that I'm used to rename.
[Piwigo Bugtracker #412](http://piwigo.org/bugs/view.php?id=412)
<!-- github-sync-id:97254094 -->
I don't understand the logic :-/ Only the category name is displayed, not the directory name (which is available only if the category is physical). Such a sort won't work for virtual categories.
By default for a physical category, category name = directory name. After creation, you can modify the category name the way you want, without taking into account the directory name.
**Comment posted by plg on 13 Jun 2006 15:30**
I don't understand the logic :-/ Only the category name is displayed, not the directory name (which is available only if the category is physical). Such a sort won't work for virtual categories.
By default for a physical category, category name = directory name. After creation, you can modify the category name the way you want, without taking into account the directory name.
<!-- github-comment-id:124888610 -->
So, it may depend on the way I am using the directory and the category names. As far as I am concerned, I always put the date (e.g. 060613_) as prefix of my directories to ensure that there are ordered chronologically in my filesystem. Then, when I upload them in PWG, I remove this prefix because it is not very beautiful in menu, but I want to keep the ordering of the dir names with this prefix.
**Comment posted by Eric B on 13 Jun 2006 18:40**
So, it may depend on the way I am using the directory and the category names. As far as I am concerned, I always put the date (e.g. 060613_) as prefix of my directories to ensure that there are ordered chronologically in my filesystem. Then, when I upload them in PWG, I remove this prefix because it is not very beautiful in menu, but I want to keep the ordering of the dir names with this prefix.
<!-- github-comment-id:124888626 -->
Roadmaped for branch 1.7, I would like to improve the concept of "automatic sorting". Choosing the field (name, directory, last update), the order (ascending, descending) and the target (the sub-categories of the current categories or the whole sub-tree). In this context, this feature request is related to #408.
To solve your immediate problem, here is the specific solution... Release 1.6.x, in admin/cat_list.php, line 121, replace
**Comment posted by plg on 13 Jun 2006 19:30**
Roadmaped for branch 1.7, I would like to improve the concept of "automatic sorting". Choosing the field (name, directory, last update), the order (ascending, descending) and the target (the sub-categories of the current categories or the whole sub-tree). In this context, this feature request is related to #408.
To solve your immediate problem, here is the specific solution... Release 1.6.x, in admin/cat_list.php, line 121, replace
SELECT id, name
by
SELECT id, name, dir
... then line 129, replace
```
$categories[ $row['id'] ] = strtolower($row['name']);
```
by
```
$categories[ $row['id'] ] = strtolower($row['dir']);
```
<!-- github-comment-id:124888640 -->
No, I don't think so. The idea is good, nothing was implemented yet, I just gave a hardcoded workaround. I still want to add an enhanced "sort form" on categories management page.
**Comment posted by plg on 4 Jun 2008 21:21**
VDigital wrote:
> To close ?
No, I don't think so. The idea is good, nothing was implemented yet, I just gave a hardcoded workaround. I still want to add an enhanced "sort form" on categories management page.
<!-- github-comment-id:124888665 -->
4 years later, I think this issue can be closed, it is possible to sort the categories in v2.4.5
**Comment posted by Eric B on 25 Nov 2012 09:06**
4 years later, I think this issue can be closed, it is possible to sort the categories in v2.4.5
<!-- github-comment-id:124888667 -->
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Reported by Eric B on 11 Jun 2006 21:55
Version: 1.6.0RC2
In Categories management, there is a "order alphanumerically" button, but it only takes care of the categories name. I wish I could have a similar button for the directories names which are my main categories that I'm used to rename.
Piwigo Bugtracker #412
Comment posted by plg on 13 Jun 2006 15:30
I don't understand the logic :-/ Only the category name is displayed, not the directory name (which is available only if the category is physical). Such a sort won't work for virtual categories.
By default for a physical category, category name = directory name. After creation, you can modify the category name the way you want, without taking into account the directory name.
Comment posted by Eric B on 13 Jun 2006 18:40
So, it may depend on the way I am using the directory and the category names. As far as I am concerned, I always put the date (e.g. 060613_) as prefix of my directories to ensure that there are ordered chronologically in my filesystem. Then, when I upload them in PWG, I remove this prefix because it is not very beautiful in menu, but I want to keep the ordering of the dir names with this prefix.
Comment posted by plg on 13 Jun 2006 19:30
Roadmaped for branch 1.7, I would like to improve the concept of "automatic sorting". Choosing the field (name, directory, last update), the order (ascending, descending) and the target (the sub-categories of the current categories or the whole sub-tree). In this context, this feature request is related to #408.
To solve your immediate problem, here is the specific solution... Release 1.6.x, in admin/cat_list.php, line 121, replace
SELECT id, name
by
SELECT id, name, dir
... then line 129, replace
by
Comment posted by VDigital on 14 Feb 2008 16:07
To close ?
Comment posted by plg on 4 Jun 2008 21:21
VDigital wrote:
> To close ?
No, I don't think so. The idea is good, nothing was implemented yet, I just gave a hardcoded workaround. I still want to add an enhanced "sort form" on categories management page.
Comment posted by Eric B on 25 Nov 2012 09:06
4 years later, I think this issue can be closed, it is possible to sort the categories in v2.4.5
In recent versions of Piwigo can sort by date, so I close the issue.