2

sorry, I am a bloody beginner, so this question might be obvious to someone else. However, I cannot figure them out. I have a blank Magento (2.2.6) installation and I want to customize it (couple plugins and my own theme).

By default, there is the Luma theme. It shows some content defined in the content > blocks (i.e. Footer Links Block, Home Page Block, etc...). If I switch the theme to blank they don't show up anymore. Why? Where is this defined, I cannot find anything in the luma themes code that references those blocks.

So next I want to create my own theme, extending Luma. I do so just by defining my Theme according to the docs (registration.php, composer.json and theme.xml with <parent>Magento/luma</parent>. It is then displayed in the list of themes as it should, also showing Luma as its parent theme. However switching to my theme just looks like the blank theme, not the Luma theme. Why that?

Next attempt was to copy all the code from the Luma theme into my theme. And voila it almost looks like Luma. The only thing is still that content blocks are not displayed as they are in Luma. Again, where is the definition for that?

BTW:

I have developer-mode enabled, and i think all possibly helpful scripts habe been run in each individual step including setup:upgrade, setup:di:compile, setup:static-content:deploy -f, cache:clean and cache:flush

  • Magento 2.2.6
  • PHP 7.1.21
  • Can you upload the screenshot of 2 themes so that I can understand which blocks are missing or not showing like luma? – Sukumar Gorai Sep 26 '18 at 8:10
1

======= EDIT =======

I got hold of the sample data and this is what should be happening from what I can see:

The homepage blocks are set using a widget which is defined in Content > Elements > Widgets under the title 'Home Page'. If you click into that widget instance you should see that it has a Layout Update which shows it on the home page and that it has a Design Package/Theme of Luma. If you then click the "Widget Options" on the left sidebar you should see that it is setting a CMS static block with the title of 'Home Page Block'. This means that when the widget is rendered on the home page it will display whatever content is in that static block.

So to enable the static blocks on your custom theme or the blank theme I would create another widget using the same configurations as the above except with the difference of specifying a different Design Package/Theme.

Hope this helps!

======= ORIGINAL ANSWER =======

Apologies to begin with as I don't currently have the sample data installed so I can't physically check this myself but...

If you go into admin and look in Content > Elements > Blocks for an identifier name 'home-page-block' do you see anything? I would expect that there is a block in there which holds the html for the yoga pants etc.

And then next I would look in Content > Elements > Widgets to see if there are any widgets set up to use the above block (if found).

And then I would look in Content > Elements > Pages for a home page that calls either the widget or block.

Sorry for being vague and hopefully this helps you find your answer!

0

I cannot edit my post because i was posting as a guest. I think that none of the blocks are displayed. I attached a screenshot of the home page with Luma theme and Blank theme. Luma displays the content block, Blank displays nothing. The same happens for the footer-links-block, displayed in Luma not in Blank (or any other theme for that matter)

enter image description here

enter image description here

0

After connecting your theme, you don't see anything on the home page because the content of the home page is a widget. Go to Content>Widgets. Open any widget and see that it is tied to the "design Pack/Theme". For it to appear in your theme, you must create your widget and link it to your theme.

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.