To get the root parent you would have to write a plugin and traverse up until you hit parentCid=0, this isn't available in core.
To detect page changes listen to the action:ajaxify.end client side event.
Is their an exporter for NodeBB to switch back to MyBB or other forum software?
To elaborate more: NodeBB is good software but without a CSS and Template Editor it simply doesn't meet my needs and I'd like to switch back to MyBB if at all possible.
@nsuchy There is a raw CSS editor in the admin panel.
As for a convertor, you'd have to see if someone on the MyBB side has set one up.
I love the raw CSS editor, simple clean