O'Reilly logo

Magento 2 Developer's Guide by Branko Ajzele

Stay ahead with the world's most comprehensive technology and business learning platform.

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, tutorials, and more.

Start Free Trial

No credit card required

Widgets

Magento provides support for widgets. Though the word "widget" might imply frontend development skills and activities, we will look at them as a part of the backend development flow because creating useful and robust widgets requires a significant amount of backend knowledge.

Magento provides several out-of-the-box widgets; some of them are as follows:

  • CMS page link
  • CMS static block
  • Catalog category link
  • Catalog new products list
  • Catalog product link
  • Catalog products list
  • Orders and returns
  • Recently compared products
  • Recently viewed products

To create a fully custom widget, we start by defining app/code/Foggyline/Office/etc/widget.xml with content, as follows:

<widgets xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" xsi:noNamespaceSchemaLocation="urn:magento:module: ...

With Safari, you learn the way you learn best. Get unlimited access to videos, live online training, learning paths, books, interactive tutorials, and more.

Start Free Trial

No credit card required