[BUGFIX] Analyse full root line of pages to know main/sub template

This patch fixes an issue where if a page is a subpage of another page and that parent page defines "template for subpages" but the current page sets its own "template for this page", the field to define values to use for sub pages would not be displayed.

Problem is solved by continuing to analyse the root line of pages even after a main controller action has been found.