I am creating a custom route as an example. Here is the code;
In etc/frontend/routes.xml
<?xml version="1.0"?>
<config xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:App/etc/routes.xsd">
<router id="standard">
<route id="foo" frontName="foo">
<module name="[Vendor]_[ModuleName]" />
</route>
</router>
</config>
In Controller/Index/Index.php
<?php
namespace [Vendor]\[ModuleName]\Controller\Index;
use Magento\Framework\App\Action;
use Magento\Framework\Controller\ResultFactory;
class Index extends Action\Action
{
public function execute()
{
$page = $this->resultFactory->create(ResultFactory::TYPE_PAGE);
return $page;
}
}
Now if I go to /foo
I get a blank page, when I am expecting to at least see the site outline with an empty content area.
If I look at the source I see html but nothing in the body. The interesting thing are the classes on the body;
class="foo-index-index page-layout-admin-1column"
Now I expect to see foo-index-index
but why would page-layout-admin-1column
exist. I do not have a layout file for this handle.