NXP-11455: move toggleable layout wigdet logics to a generic template, for easier reuse by alternative widget type retrieving layouts to display from the document configuration