Skip to Content
Menu
Musisz się zarejestrować, aby móc wchodzić w interakcje z tą społecznością.
To pytanie dostało ostrzeżenie
1 Odpowiedz
3110 Widoki

I am not able reordering partner categories. Categories always appear in the order I have created them. In the source code, I see they are ordered by "parent_left, name", but I cannot understand what is this "parent_left" attribute and how to modify it.


Awatar
Odrzuć
Najlepsza odpowiedź
parent_left and parent_right, sets up a Nested set model to enable fast hierarchical queries on the records of the current model. These attributes are generated automatically, that are related to the parent_id field, see ORM API documentation

Here Example

Awatar
Odrzuć
Autor

Ok, thank you for this good explaination. However this does not tell me nothing about how to reorder categories...

You temporary change parent_id in all childrens, in next step restore parent_id (select positions to restore in right order).

Powiązane posty Odpowiedzi Widoki Czynność
1
mar 15
5292
0
sty 25
1400
1
lis 24
1220
2
wrz 24
2325
1
maj 23
5420