0

I'm still hanging in understanding how themes in magento 2.0.7. So far it seems one practically has not to touch a single template file, only design files it seems. Though I'm struggling to find where to start when I want to have my own design. Just a starting point where to start adjusting. Seems to be hard.

For example. I base my theme on blank. Blank has not a single template file. I found that instead module-theme delivers the template files for blank. Now I wanted to follow the conventions and create my page with design files. But it is hard to do. Template hints does not really help since it seems to only show small template parts, not the surrounding templates and it does not show the design files at all.

I then found that default.xml seems to define somewhat of a base layout. So I copied the default.xml from module-theme. I found that seems to be defined in there and I can find it in sourcecode then. Though in sourcecode there are more surrounding divs:

It seems none of them is defined in default.xml, though I need to access those classes in order to put in my own classes to define my design.

So can someone tell me where to look at to finally find the real main design file where everything starts?

Thank you!

PS: I would like to write registered but it seems stackexchange has a problem with the email formats. It seems it does not understand that an email can contain a "-", which is a problem I came over on many sites. It leads to me not getting a single email from stackexchange. Unfortunately I can't even ask in meta, where the right place should be, because only registered users can post... ::)

1
  • It seems all my html-tags were removed without notice. So here again: I found that div panel-header seems to be defined in there and I can find it in sourcecode too. Though in sourcecode there are more surrounding divs: div class="page-wrapper" header class="page-header" div class="panel wrapper"
    – user789660
    Jun 10, 2016 at 8:28

1 Answer 1

0

The base layout file is inside vendor/magento/module-theme/view/frontend/layout/default.xml

If you create a theme extending the blank one then you also have to consider vendor/magento/theme-frontend-blank/Magento_Theme/layout/default.xml, this one get merged with the previous one (if i'm right)

In you custom theme you should have /app/design/frontend/<package>/<theme>/Magento_Theme/layout/default.xml and you can apply your changes here.

9
  • Thanks for answering. I think you are right that blank is adjusting that design xml. But I somehow think that that xml is not really the base one. Since the highest classes, when talking about how a webpage is build with wrapper, maindiv and only then header, content and footer (for example) seems to not be defined in there. Though when properly building a website I would need to have access on these higher div levels too. What I found now is that I might have to create a default.xml and put it into an override folder. Maybe I can fully customize my theme so. Have to figure out paths now.
    – user789660
    Jun 10, 2016 at 11:05
  • Ah ok, then i think you are looking for the files inside vendor/magento/module-theme/view/frontend/page_layout/
    – Lorenzo
    Jun 10, 2016 at 11:50
  • I think I got a step further. I still don't get it why a default.xml overriding and is containing nothing between the page tags still show things in sourcecode but now I copied the content of empty.xml in there and I have an empty body-tag now. Unfortunately it seems to be a page configuration file now, not a page layout file anymore. Why does this have to be made to so complicated... sigh
    – user789660
    Jun 10, 2016 at 12:27
  • Only now saw your comment. I will check them out, they seems to be configuration files too. Will see what can be done with them...
    – user789660
    Jun 10, 2016 at 12:28
  • It seems container name="root" in a page config file refers to the body tag. I wonder if there is a list of the available container names. If adding container name="root" to a page config file then I can have a clean body tag without things inside of body. Though there still are some tags in the body tag itself. I did not find where that comes from.
    – user789660
    Jun 10, 2016 at 12:32

Your Answer

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

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