0

I can deal with layouts to move blocks and any action to be made over blocks in Magento 2. I can even modify templates for each block individually.

But, how can I modify a container block? I cannot find the template whose draws it. For example, the phtml file that draws the whole page container.

I need actually to find the header container that draws this:

<header class="page-header"><div class="magestore-bannerslider">
    </div>
<div class="header content"><span class="action nav-toggle" data-action="toggle-nav"><span>Nav de palanca</span></span>
    <strong class="logo">
        <img width="119" height="110" alt="Para Mi Casa" src="http://www.depasa.cl/pub/media/logo/default/logo-depasa.png">
    </strong>

<div class="minicart-wrapper" data-block="minicart">
    <a data-bind="scope: 'minicart_content'" href="http://www.depasa.cl/checkout/cart/" class="action showcart">
        <span class="text">Mi carrito</span>
        <span data-bind="css: { empty: cart().summary_count == 0 }, blockLoader: isLoading" class="counter qty empty">
            <span class="counter-number"><!-- ko text: cart().summary_count --><!-- /ko --></span>
            <span class="counter-label">
            <!-- ko if: cart().summary_count -->
                <!-- ko text: cart().summary_count --><!-- /ko -->
                <!-- ko i18n: 'items' --><!-- /ko -->
            <!-- /ko -->
            </span>
        </span>
    </a>

        <script>
        window.checkout = {"shoppingCartUrl":"http:\/\/www.depasa.cl\/checkout\/cart\/","checkoutUrl":"http:\/\/www.depasa.cl\/checkout\/","updateItemQtyUrl":"http:\/\/www.depasa.cl\/checkout\/sidebar\/updateItemQty\/","removeItemUrl":"http:\/\/www.depasa.cl\/checkout\/sidebar\/removeItem\/","imageTemplate":"Magento_Catalog\/product\/image_with_borders","baseUrl":"http:\/\/www.depasa.cl\/","customerLoginUrl":"http:\/\/www.depasa.cl\/customer\/account\/login\/","isRedirectRequired":false,"autocomplete":"off","captcha":{"user_login":{"isCaseSensitive":false,"imageHeight":50,"imageSrc":"","refreshUrl":"http:\/\/www.depasa.cl\/captcha\/refresh\/","isRequired":false},"guest_checkout":{"isCaseSensitive":false,"imageHeight":50,"imageSrc":"","refreshUrl":"http:\/\/www.depasa.cl\/captcha\/refresh\/","isRequired":false}}};
    </script>

<div class="ui-dialog ui-widget ui-widget-content ui-corner-all ui-front mage-dropdown-dialog" style="display: none;" tabindex="-1" role="dialog" aria-describedby="ui-id-1"><div data-role="dropdownDialog" class="block block-minicart empty ui-dialog-content ui-widget-content" id="ui-id-1" style="display: block;">
            <div data-bind="scope: 'minicart_content'" id="minicart-content-wrapper">
                <!-- ko template: getTemplate() --><!-- /ko -->
            </div>
        </div></div></div>


<div class="block block-search">
    <div class="block block-title"><strong>Buscar</strong></div>
    <div class="block block-content">
        <form method="get" action="http://www.depasa.cl/catalogsearch/result/" id="search_mini_form" class="form minisearch">
            <div class="field search">
                <label data-role="minisearch-label" for="search" class="label">
                    <span>Buscar</span>
                </label>
                <div class="control">
                    <input type="text" autocomplete="off" aria-autocomplete="both" aria-haspopup="false" role="combobox" maxlength="128" class="input-text" placeholder="Busque aquí en toda la tienda..." value="" name="q" id="search">
                    <div class="search-autocomplete" id="search_autocomplete" style="display: none;"></div>
                    <div class="nested">
    <a data-action="advanced-search" href="http://www.depasa.cl/catalogsearch/advanced/" class="action advanced">
        Búsqueda avanzada    </a>
</div>
                </div>
            </div>
            <div class="actions">
                <button class="action search" title="Buscar" type="submit" disabled="">
                    <span>Buscar</span>
                </button>
            </div>
        </form>
    </div>
</div>
<ul class="compare wrapper"><li data-role="compare-products-link" data-bind="scope: 'compareProducts'" class="item link compare">
    <a data-bind="attr: {'href': compareProducts().listUrl}, css: {'no-display': !compareProducts().count}" title="Comparar productos" class="action compare no-display">
        Comparar productos        <span data-bind="text: compareProducts().countCaption" class="counter qty"></span>
    </a>
</li>

</ul><div class="panel header"><a href="#contentarea" class="action skip contentarea"><span>Ir al contenido</span></a>

<ul class="header links">        <li data-bind="scope: 'customer'" class="greet welcome">
            <span data-bind="text: customer().fullname ? $t('Welcome, %1!').replace('%1', customer().fullname) : '¡Bienvenido a Depasa!'"></span>
        </li>

    <li data-label="o" class="authorization-link">
    <a href="http://www.depasa.cl/customer/account/login/">
        Iniciar sesión    </a>
</li>
<li><a href="http://www.depasa.cl/customer/account/create/">Crear una cuenta</a></li></ul></div>
<nav role="navigation" class="navigation">
    <ul id="ui-id-2" class="ui-menu ui-widget ui-widget-content ui-corner-all" role="menu" tabindex="0">
        <li class="level0 nav-1 first last level-top ui-menu-item" role="presentation"><a class="level-top ui-corner-all" href="http://www.depasa.cl/luz-para-el-hogar.html" id="ui-id-3" tabindex="-1" role="menuitem"><span>Luz para el hogar</span></a></li>    </ul>
</nav>
</div></header>

With that block, I have set the header to have the top links, the topmenu, the logo and the search module, but according to the design for my page, I need to change radically the HTML markup, since the containing div and below.

Any hints please?

3

You could use Template Hints to tell you which .phtml template you need to edit. Magento 2 has this, the same as Magento 1 does, just in a different place in the admin. See this thread: Where is Template Path Hints in Magento 2?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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