1

I was wondering if there's a way to change the position of elements in an entry type structure. I want to change the positions of the elements when a user logs in, so I'll write it in a plugin.

Any Ideas?

3
  • are you talking about frontend displaying the elements in a different order or in the admin panel?
    – mrsmn
    Aug 30 '17 at 6:54
  • Admin panel but I've found a solution Aug 30 '17 at 7:11
  • Feel free to post it here as an answer for future reference for other developers who might want to do the same thing.
    – mrsmn
    Aug 30 '17 at 7:12
2

This did the trick:

 craft()->sections->reorderEntryTypes($entryTypeIds);

Where $entryTypeIds is an array with all the id's in the correct order

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.