2009/04/08

Move category up, up and away!


Recently I needed to move newly created category name higher. So I logged as administrator, went to mymoodle.com/course/index.php page, pressed Turn editing On and..waited..waited..and waited.


I am not sure about using Ajax with moving up/down categories, but by default it could take a while to render form with all categories and subcategories. It surely took me a while for a form with 144 categories and subcategories. When you have subcategories in three level category tree it is getting to add up ;-).

Move newly created category, of course it placed itself just at the bottom, would be really bothersome with such a loading times.

So I got an idea with a quick, dirty solution. Maybe I am just dumb and you all know this, but it took me a while so I want to spare you some minutes thinking.

Survive first form loading, select category to be moved, press up or down arrow in the direction you want category to move, click it, wait for a second, just for page to start to render and stop the loading.

It's a red cross right of refresh button on your browser.



This will stop rendering form with categories and subcategories, but all hard work has already been done behind the curtains. So just enter URL in your address bar (there should be something like yourmoodle.com/course/index.php?moveup=66&sesskey=HoNFzG43Zy - moveup parameter is for category and sesskey is needed for security) or press refresh button (F5 key usually) and repeat stopping/refreshing page few steps needed for category to find new shiny place to live.

I hope I didn't insult my dear readers with such a lazy dirty trick, but these tricks are the best one and sometimes the hardest ones to think up.