As far as I know, you “should” be able to implement a custom Vertical XBlock by uninstalling the normal one and installing a subclass of it that has the same vertical
entry point. I’m not sure why that wouldn’t be working; perhaps you haven’t removed the existing entry point?
It should be fine as long as you subclass the existing blocks. If you tried to replace VerticalBlock
with UnitBlock
or replaced VerticalBlock with something entirely custom, then you’d have problems. But swapping out VerticalBlock for a custom subclass which has the same entry point (vertical
) should be fine as far as I can think.
Well one option is that you can use the XBLOCK_EXTRA_MIXINS
setting to add a mixin class to all XBlocks on the platform, which can define new data/metadata fields and do anything else that you’d like. It applies to all blocks but you can ignore its data and/or make it do nothing for most XBlocks other than vertical
.
Another solution is to not store this data using XBlocks at all, but rather store it in a separate table with a foreign key to the XBlocks. That’s what I did in the Tagstore API I previously designed for storing taxonomies in Open edX and associating them with XBlocks (or users or anything else), though I never got to finish that project. See the recent thread Tagging a question in Open edX where someone asked a similar question and I gave a similar answer. You may even want to collaborate with them. A separate table is much cleaner and simpler but the big downside is the data won’t be copied if you e.g. duplicate the XBlock in Studio or re-run the course. So it works well for people using content libraries but probably not as helpful if most of your authoring and tagging happens within courses that are then copied or re-run.
There are hacky ways to do this but no clean way that I know of. It would be better to implement a non-XBlock plugin that renders your custom tagging control in Studio alongside the unit in question, and stores its data in a separate table. You can also do this as an XBlock mixin that adds its control widget to the studio_view
or author_view
of whatever XBlocks you want, without modifying their code.