Map page templates to layout files
An MVC page template and a layout file are associated to each other via the naming convention. If you rename the layout file, the relationship with the page template breaks and a new page template is generated. Similarly, if you delete a layout file, the page template continues to exist and function, you can configure and edit the grid and content widgets on pages, based on this template but you cannot edit the layout file itself. This means you cannot edit the placeholders, markup, and links. To do so, you need to map the page template to a layout file. In addition, if this layout file had hardcoded links, or you need to add an extra class or meta tag, you cannot do that until you create a new layout file and map the page template to it in accordance with the naming conventions. For more information, see Naming conventions.
On the other hand, if you delete the page template, associated to a layout file, you can later create a new template and map it to the layout file, so that you can work with it and use it in the file system.
The following sections describe in detail these scenarios, which are uncommon use cases:
- Create a new layout file
- Create an MVC page template and map it to a layout file
- Map a layout file to an existing MVC page template