Allow ordering of drawer items
It would be very useful to have control over the positioning of items which appear in the drawer.
also see #534
Hi @ratnadeeprajput , Are you currently working on this? If not, do you mind if I give it a go?
@barryo-learningpool - sure, please proceed.
Hi guys, I need some pointers on how to go about this. Is it safe to assume that only "Extensions" will ever populate the drawer? If not, do we need a hasDrawer flag on plugins?
And then does it seem like a good idea to have a sortOrder property on plugins/extensions or should we keep this separate somewhere?
Is it safe to assume that only "Extensions" will ever populate the drawer?
Yes I think so.. I certainly can't think of an example of anything other than an extension putting content into the drawer.
And then does it seem like a good idea to have a sortOrder property on plugins/extensions or should we keep this separate somewhere?
I think the extension developer should be responsible for declaring this property and exposing it to the course author. But we should recommend a name and location for this, _drawerOrder would be good and since most extensions that list themselves in the Drawer have an entry in course.json, that would be the recommended place to put that property, alongside the _isEnabled property, ideally.
What I would then do is add an order argument to drawer.addItem that extensions could then pass their order property to - or not.
In the event that two extensions have the same drawerOrder set I would suggest a 'you snooze you lose' policy in which the first one to register get the desired position and the runner-up gets added after it.
Extensions that don't pass drawerOrder argument to drawer.addItem should just be added to the end of the collection.
@moloko Thanks for the pointers, much appreciated.
It seems ordering the collection by the drawerOrder attribute works quite nicely.
See my change and comments here: https://github.com/adaptlearning/adapt_framework/pull/1685
I like this. We also need a left, right, center + order for the navigation bar.
Cheers @oliverfoster. Is that covered in #1555 ?
Yup, I just figure, whilst your brain is fresh on the subject you might like to tackle it?
this is now resolved in core, resources and glossary
Kineo have updated their search extension and a message was posted in the community forums asking people who maintain extensions that use to drawer to update their extension to support _drawerOrder
don't think there's anything more to do here...