Magento 2 – Load a PHTML for Homepage

magento2

i just installed magento 2.1 on localhost, in \app\design\frontend there is only a Magento folder. The logo is using luma.

i've read this post
How to load a phtml file only for homepage? (Magento 2)

But my problems is if i create this

/app/design/frontend/name/themename/Magento_Cms/layout/cms_index_index.xml

What is the name and themename (exact path) should be, anyone know? And if i use this code in above xml

<?xml version="1.0"?>
<page xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" layout="1column" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
   <referenceContainer name="page.top">
     <block class="Magento\Framework\View\Element\Template" name="startphoto" template="Magento_Theme::html/startphotos.phtml">
        <arguments>
            <argument name="section" xsi:type="string">homepage</argument>
            <argument name="position" xsi:type="number">0</argument>
        </arguments>
     </block>
  </referenceContainer>         
</page>

What is the exact path of startphotos.phtml should be?

"UPDATE 1"

i have placed the cms_index_index.xml at

C:\xampp\htdocs\m2\app\design\frontend\randomname\theme-frontend-luma\Magento_Theme\layout

and startphotos.phtml at

C:\xampp\htdocs\m2\app\design\frontend\randomname\theme-frontend-luma\Magento_Theme\template\html

But nothing appear in homepage, any ideas? Should i need to use any command make it appear?

"UPDATE 2"

i have created a theme copy from vendor\magento\theme-frontend-luma to C:\xampp\htdocs\m2\app\design\frontend\randomname\luma_clone

layout location: app\design\frontend\randomname\luma_clone\Magento_Theme\layout

phtml location: app\design\frontend\randomname\luma_clone\Magento_Theme\template\html

nothing appear.

"UPDATE 3"
The problem was solved because of template**(s)**

Best Answer

The path you have given looks for the template in

/app/design/frontend/name/themename/Magento_Theme/template/html/startphotos.phtml

edit: Oh, I see it is a multi-part question.

The name and themename should be your company and you childthemes name. Please see the official documentation on how to create a theme:

http://devdocs.magento.com/guides/v2.1/frontend-dev-guide/themes/theme-create.html

To create a child-theme, please see this: How to create a Child Theme in Magento 2

Related Topic