1

I'm so close to having this site finished and then this happens. I logged into the customer account section to check all was good and then i was greeted with this...

enter image description here

It should look like this...

enter image description here

I achieved this by doing the following. Getting rid of margin-bottom: 0; on .page-main .block but i cant find anywhere in the .less files where this is coming from.

enter image description here

I then moved page-title to just under column main

enter image description here

That achieves the required result but other than in inspect element i cant get it to work. I have added !important to the .page-main .block in the magento_customer/web/css/source/module.less which did nothing after recompiling, clearing static-content and cache.

I also believe that my customer_account.xml file is correct

<?xml version="1.0"?>
<!--
/**
 * Copyright © 2015 Magento. All rights reserved.
 * See COPYING.txt for license details.
 */
-->
<page layout="2columns-left" xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd">
    <body>
        <referenceContainer name="sidebar.main">
            <block class="Magento\Framework\View\Element\Template" name="customer_account_navigation_block" template="Magento_Theme::html/collapsible.phtml" before="-">
                <arguments>
                    <argument name="block_title" translate="true" xsi:type="string">Account Dashboard</argument>
                    <argument name="block_css" xsi:type="string">block-collapsible-nav</argument>
                </arguments>
                <block class="Magento\Framework\View\Element\Html\Links" name="customer_account_navigation" before="-">
                    <arguments>
                        <argument name="css_class" xsi:type="string">nav items</argument>
                    </arguments>
                    <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-account-link">
                        <arguments>
                            <argument name="label" xsi:type="string" translate="true">Account Dashboard</argument>
                            <argument name="path" xsi:type="string">customer/account</argument>
                        </arguments>
                    </block>
                    <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-account-edit-link">
                        <arguments>
                            <argument name="label" xsi:type="string" translate="true">Account Information</argument>
                            <argument name="path" xsi:type="string">customer/account/edit</argument>
                        </arguments>
                    </block>
                    <block class="Magento\Framework\View\Element\Html\Link\Current" name="customer-account-navigation-address-link">
                        <arguments>
                            <argument name="label" xsi:type="string" translate="true">Address Book</argument>
                            <argument name="path" xsi:type="string">customer/address</argument>
                        </arguments>
                    </block>
                </block>
            </block>
        </referenceContainer>
        <move element="page.main.title" destination="content.top" before="-"/>
    </body>
</page>

the <move element="page.main.title" destination="content.top" before="-"/> line being the one that should put the title to the top from what I've read. I understand that this is a duplicate question but not one thing I tried has worked.

The only thing I found that might help is someone said about if there is a module installed that uses sequence or something but I'm no expert and really don't know.

If no one can help me is there a quick and safe way to disable and re-enable modules so i can diagnose the problem child.

8
  • Can you share your url? Aug 31 '18 at 9:08
  • Its internal only at the moment sorry
    – Carl Piper
    Aug 31 '18 at 9:12
  • Ok no problem. If you uncheck the margin-bottom then it looks fine? Right? If yes then override it with more nested it should work like. .customer-account-index .page-main .block{margin-bottom: initial;} or .customer-account-index .page-main .block{margin-bottom: unset;} Aug 31 '18 at 9:16
  • right i added .customer-account-index .page-main .block{margin-bottom: initial;} to the bottom of the module.less file. Is that not correct as it hasnt taken effect.
    – Carl Piper
    Aug 31 '18 at 9:46
  • Does it working by inspect element after addition of that code? Aug 31 '18 at 10:11
1

it is might be a core bug see : https://github.com/magento/magento2/issues/16786

How to fix :

Goto : vendor/magento/module-theme/view/frontend/layout/default.xml

Search for This

<container name="content.top" label="Main Content Top"/>

Replace it with the following one:

<container name="content.top" label="Main Content Top" before="-"/>

Please do not forgot to clear cache etc..

For more detail see : https://mage2.pro/t/topic/1990

Thanks

2
  • You star!!! thats done it, id read that article early into my research but didn't want to modify the core but oh well i was desperate.
    – Carl Piper
    Aug 31 '18 at 10:58
  • Yeah, some time we need to update core file, but you can also override this xml file into your theme so whenever you upgrade magento version, This changes remain as it is. Aug 31 '18 at 11:51
0

There is a better solution explained here that does not require overwriting any core files: https://magento.stackexchange.com/a/190855/3830

Simply create a new customer_account.xml in app/design/frontend/<Package>/<theme>/Magento_Customer/layout/ and add the following content:

<?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" layout="2columns-left" xsi:noNamespaceSchemaLocation="urn:magento:framework:View/Layout/etc/page_configuration.xsd" label="Customer My Account (All Pages)" design_abstraction="custom">
    <body>
        <move element="page.main.title" destination="content" before="-" />
    </body>
</page>

Clear the cache, and the issue will be fixed.

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.