Making id_code accessible to template