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?)

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

  • 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 '16 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 '16 at 21:59

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.