Mouse click Advanced Settings and click on Section Template
The code which is common to the sections of the website should go in individual sections.
You can define a directory for each section template. So that when a page is created using the section template the directory will be auto chosen for the page created.