2

In the sample data with the Luma theme the home page is implemented with a Widget ("Home Page" Widget of type "CMS Static Block") plus block ("Home Page Block" containing the page content area html).

Particularly for a learning example, why not simply use a Page? It seems you can put the content into the Page, and assign the page to the CMS Home Page > Main Content Area. Would that not achieve the same effect?

(Related question with diagram: How does Luma theme home page work?)

2 Answers 2

1

why not simply use a Page?

That's the goal of sample data: show samples / examples of what can be achieved in Magento. The widget is there to show how widgets work.

Would that not achieve the same effect?

Yes you can get the same effect by copy/paste the content of the CMS block in the CMS page content and remove the widget.

It becomes useful to use such widgets when you have several different blocks in your page and they have different purposes. E.g one widget for site presentation and one widget for current sale. You can disable the current sale block when the sale is over and thus you don't have to delete/comment content from the page

2
  • The sample home page actually includes a widget inserted in the "Home Page Block" html content, so "widgets you can exchange easily" seems covered there. Meanwhile, in the Pages list, there's a page titled Home Page which one might expect to contain the home page content, but is, confusingly, empty. I now know how all this works, but as an example of how to do things it wasn't very illuminating. That said, I may just accept "hey, it was an example" unless someone comes up with a good use case for this homepage-in-a-block-in-a-widget arrangement.
    – gwideman
    Oct 31, 2016 at 0:08
  • Revisiting this, I see I hadn't previously noted the flexibility that the widget + block (+ template) offers versus the plain page. Eg: though you can place a widget in a plain page, you have to configure that widget on the spot (you don't pick it from the list of previously configured ones). So you can't share it with elsewhere on the site, and enabling/disabling it is a more surgical operation. As compared to the Content > Widgets which you can target to various site locations (including home page) using settings the don't require fiddling in the html editor.
    – gwideman
    Nov 5, 2016 at 21:59
0

So Blocks are there to fill content into the page Widget structure that is already provided by the LUMA theme?

So LUMA sounds like it provides page structure via Widgets and the content developer finds the correct Widget to place the Content in?

Is there a LUMA "page Widget map" that points out the location of the Widgets on a particular page?

As far as theming goes do you see any problem with the way I am using CSS and not LESS?

OMG, this is such great info!! Thank you so much!!!

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.