Layout Script

A layout script contains the outer "shell" of the website and generally includes header, navigation and footer sections. The example below uses several view helpers. The .main div is where the content from individual view scripts will be injected.

The layout file below would be located at /application/design/yourtheme/layouts/scripts/layout.phtml.

<?= $this->doctype('HTML5'); ?>
<html>
    <head>
        <?= $this->headMeta(); ?>
        <?= $this->headTitle()
                ->setSeparator(' | ');
?>
        <?=
            $this->headLink()
                ->prependStylesheet('/design/yourtheme/css/normalize.css')
                ->appendStylesheet('/design/yourtheme/css/app.css');
        ?>
        <?=
            $this->headScript()
                ->prependFile('//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js')
                ->appendFile('/design/yourtheme/js/app.js');
        ?>
    </head>

    <body class="<?= $this->BodyClass(); ?>">

        <div class="wrapper">

            <header>
                <a href="/"><img src="/design/yourtheme/images/logo.png"></a>
            </header>

            <nav>
                <?= $this->navigation()->menu(); ?>
            </nav>
            
            <div class="main">
                <?= $this->layout()->content; ?>
            </div><!-- .main -->

            <footer>
                <p>Essential Logic <?= date('Y'); ?></p>
            </footer>

        </div><!-- .wrapper -->

    </body>
</html>
Related nodes
$nodes = $this->node->getCollection()->getRelated();