1

I am a newbie to Magento and I am trying to create a child theme with the parent as blank.

Now my task is to override the full layout and map bootstrap CSS so I don't want to read the CSS structure of Magento as will I could create responsive layouts easily. In simple words, I can have better control over the template.

I was able to override default.xml file in my theme. Now if I map the .phtml file from the templates folder, I am getting the error as

1 exception(s): Exception #0 (Magento\Framework\Exception\ValidatorException): Invalid template file: 'Magento_Theme::html/navbar.phtml' in module: '' block's name: 'header.container_schedule_block0'

default.xml

<?xml version="1.0"?>
<!--
/**
 * Copyright © Magento, Inc. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<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">
           <block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/navbar.phtml"></block>
        </referenceContainer> 
    </body>
</page>

navbar.phtml

<?php

echo "Hello world" ?>

My folder structure is as attached.

enter image description here

I am sure, I didn't understand the documentation properly. So please do not refer the documentation link. Please point the mistake and how to clear the error.

Magento Version 2.2.4

Thanks.

1 Answer 1

2

<block class="Magento\Framework\View\Element\Template" template="Magento_Theme::html/navbar.phtml"></block>

According to your folder structure, it should be like below

<block class="Magento\Framework\View\Element\Template" template="Magento_Theme::navbar.phtml"></block>

1
  • If you are familiar with Magento templating, can u brief me how to override the full layout and create pages. Might be one hour of guidelines is more than enough. I will be available at +91-9952762769. Please help me out, where i am ready to pay for your time. May 24, 2018 at 7:36

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.