Generate ids based on heading parent