You shouldn't edit code directly from magento codebase: vendor/magento.
To add a selectable layout to CMS page, create a selectable layout file for CMS pages:
cms_page_view_selectable_<CMS Page Identifier>_<Layout Update Name>.xml
where:
- CMS Page Identifier is the desired page’s URL Key with “/” symbols replaced with “_”.
- Layout Update Name is what is shown as the option for the Custom
layout update field of the Design section on the CMS Page Edit page.
For example, a layout update for an “About Us” page will be
“cms_page_view_selectable_about-us_AboutUs.xml”.
This file must be placed in the appropriate folders for layout XML files, it be located in:
- in your module:
<module dir>/view/frontend/layout
- in your theme:
<theme dir>/Magento_Cms/layout
Sample code for cms_page_view_selectable_about-us_AboutUs.xml file
(your file content should be the same):
<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
<body>
<referenceContainer name="header.container" remove="true"/>
<referenceBlock name="catalog.topnav" remove="true"/>
<referenceContainer name="footer-container" remove="true"/>
</body>
</page>
Flush the cache and go to CMS Page Edit page, the new selectable layout was added in Custom Layout Update field of the Design section.
Source: https://magetu.com/how-to-add-a-selectable-layout-to-cms-page-in-magento-2