Skip to content
This repository has been archived by the owner on Dec 18, 2020. It is now read-only.

Categories reordering #821

Open
codeh4nter opened this issue May 29, 2017 · 4 comments
Open

Categories reordering #821

codeh4nter opened this issue May 29, 2017 · 4 comments
Labels

Comments

@codeh4nter
Copy link

codeh4nter commented May 29, 2017

Q A
Bug? no
New Feature? yes
Sulu Version 1.5.3

Is there any way to reorder categories?

@wachterjohannes
Copy link
Member

Currently, there is no plan for ordering categories but there is a PR which makes categories movable sulu/sulu#3212

@codeh4nter
Copy link
Author

Could you please explain me how to implement this feature to my sulu-minimal v1.5.3? I need to change the ordering just once but it is very important for me now.

@wachterjohannes
Copy link
Member

wachterjohannes commented Jun 6, 2017

you could extend the Category entity (see http://docs.sulu.io/en/latest/cookbook/extend-entities.html) for categories use the configuration sulu_category.objects.{model, repository}. there you can add a column order which you can set over the database and then use this column to write SQL statements in you controller. if you have any deeper question you can contact us directly over slack (register on http://sulu.io/en#questions)

@alexander-schranz
Copy link
Member

@ilyasavitski if you just want to reorder it once you could write a symfony command to reorder the categories and use the moveUp and moveDown function from the repository. The categories use the Gedmo Tree extension. Which also have a simple reorder funciton in the repository. The categories repository service you get with sulu.repository.category.

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

4 participants