The following guide sheds light on the structure of the Magento 2 backend. In particular, we explore a screen that contains all Magento 2 widgets. It is a part of the Content section, together with Pages and Blocks. Below, we describe how the Widgets grid looks and works. We also shed light on how to create widgets as well as import and export them.'
Table of contents
- 1 Magento 2 Widgets
- 2 How to Import Magento 2 widgets
- 3 How to Export Magento 2 Widgets
- 4 Improved Import & Export Features
- 4.1 Automated Import & Export Processes
- 4.2 Advanced Mapping Features
- 4.3 Extended Connectivity Options
- 5 Final Words
Magento 2 Widgets
You can find all CMS pages, blocks, and widgets under Content-> Elements. While each content type has a grid, the content we are going to describe below is available under Elements -> Pages.
Magento 2 Widgets
A grid with all widgets offers minimum control elements: search field in each column + pagination. No mass actions or custom grid views are available. The default view offers the following five columns:
- Widget ID – each widget has an ID number;
- Widget – and a name;
- Type – there are several different types of widgets;
- Design Theme – each widget is related to a particular design theme;
- Sort Order – to avoid conflicts between widgets.
How to add a Widget in Magento 2
To add a new Magento 2 Widget, hit the “Add Widget” button on the top right:
You are redirected to a section with settings. Select a widget type and design theme. Hit “Continue.”
Next, configure Storefront Properties: add a widget title, assign it to a store view, specify a sort order, and add a layout update.
In Widget Options, select a block. When everything is configured, hit the “Save” button.
How to edit a widget in Magento 2
To edit an existing widget in Magento 2, go back to the Widgets screen and double-click on an item you want to change. You can edit the same fields we’ve just described above.
How to Import Magento 2 widgets
Now, let’s see how to import widgets to Magento 2. We recommend you to use the Improved Import & Export extension since it dramatically simplifies the process and automates all transfers. The module is designed to enable the import of widgets from any external systems.
Everything you need is available under System->Improved Import/Export->Import Jobs. Here, click “Add New Job” to create a new import job. Configure the following sections of settings.
The General Settings tab lets you enable your new import job, specify its title, and add a schedule of transfers. To import widgets to Magento 2 only one time, leave this field blank. In case you need recurring transfers, create a plan. Next, you can choose a language (locale) and enable/disable unique URL generation, re-index, email notifications.
You can choose widgets as your import entity under the Import Settings section. This tab also lets you enable/disable API synchronization and select a platform to import data from. It means that you can choose and apply a mapping preset. We describe this feature below.
The Import Behavior tab offers the following options: Add/Update, Replace, or Delete. This is how the extension will import widgets. Next, choose a validation strategy, set a maximum number of errors, and type separators.
The Import Source section lets you choose the format of your import file as well as an import source: server, Google Sheet, URL, direct upload, or Dropbox.
Hit “Save & Run” when all options are configured and import widgets to Magento 2. More information is available here:
How to Export Magento 2 Widgets
When it comes to the export of Magento 2 widgets, Improved Import & Export also becomes useful. Like in the case of the corresponding import process, it both simplifies widgets export and automates all further data transfers if necessary.
You can start the new export by clicking “Add New Job” under System->Improved Import/Export->Export Jobs.
Enable the new export job and specify its title. Next, choose the frequency of exports. Leave the field empty if a single procedure is required. You can also specify a file language and divide additional attributes under the General Settings tab.
As for Export Settings, you can set Magento 2 widgets as your entity here. Enable/disable ‘Consecutive Export’ if necessary
Select a file format required by an external system and specify separators a system you provide data to utilizes.
Proceed to the Export Source tab and select a final destination: FTP, SFTP, or a data file. Check the connection.
Map attributes and specify filters to make the data output more suitable for the third-party system.
Click “Save & Run” when finished. Now, the extension lets you export Magento 2 widgets. You can find more details here:
Improved Import & Export Features
The Improved Import & Export extension offers numerous advantages over third-party import/export solutions, not to mention the default transfer tools of Magento 2. Our module can transfer all possible entities to and from your e-commerce store, so widgets are only a small part of what our plugin does.
Automated Import & Export Processes
You can automate import and export processes while transferring widgets with Improved Import & Export. Our module offers two different ways of moving data automatically. You can find them described below.
Schedules were described earlier in this article. They represent the first way of automation. The Improved Import & Export module utilizes the default cron syntax for both import and export processes, allowing you to automate all data transfers entirely. Select a predefined interval or specify a custom one. It is also possible to create a profile with no schedule like in the example above. Leverage a manual launch any time you need to transfer data related to a job asynchronously.
Event-based triggers will also help you automate integrations with external systems. They represent the second way of data transfer automation, enabling real-time updates. Select a trigger that launches data transfers, synchronizing two systems right after a specific action takes place. It means that you can start the export of widgets from Magento 2 right after a new block is generated. You can find more information here: How to Run Magento 2 Import or Export After Specific System Event or Process.
Advanced Mapping Features
Due to different standards for storing data that most e-commerce systems and related platforms have, you cannot freely transfer information between them. Merchants are forced to edit every data file before moving it into Magento 2. The same situation is typical for export processes. You should edit data files created on your e-commerce website according to the requirements of a platform you want to connect your store with. Such processes take lots of time unless you use Improved Import & Export. The module lets you apply all changes right in the backend section. Furthermore, you can do that in just a few clicks. Let’s see how the extension helps.
With Improved Import & Export, you get a bunch of mapping presets – predefined schemes that let you replace third-party attributes with ones used internally within a few clicks. Since our module does all the other work for you, it is only necessary to select a proper solution while configuring a new job. The extension scans the input data for third-party attributes and replaces them with the internal ones. The same approach is applied to export processes: the extension automatically changes Magento 2 attributes, replacing them with ones utilized within an external platform. From the perspective of an administrator, everything looks as follows:
If the necessary preset is absent, you can use a matching interface of the Improved Import & Export Magento 2 extension. You can find the section in every import and export profile. To solve the issue of different attribute standards, you have to follow these three simple steps:
- select an entity,
- choose a system attribute,
- specify a corresponding external designation.
This gif image shows how everything works:
You can also add hardcoded (default) values, providing all imported items with the same values for the selected attribute. Let’s imagine a situation when you import products from different store views. Our extension lets you move them to the same store view by providing a hardcoded value.
Use filters to narrow down the selection of data in an export file. To add a new filter, click ‘Add Filter’ and select an entity and a system attribute. Next, specify filtering parameters and create the desired output. The system lets you add as many filters as you need. Note that filter parameters may vary depending on the selected attributes.
Attribute Values Mapping & Editing
Besides, Improved Import & Export provides the ability to map and edit attribute values in the Magento 2 backend. The module lets you effortlessly eliminate incorrect designations that prevent import processes in an interface similar to the one we described above. Choose a third-party attribute value and specify a corresponding internal one in front of it, making an import file suitable for Magento 2. You can find a more specific description of this feature here: Attribute Values Mapping.
You can edit attribute values in bulk when their mapping is not enough. Improved Import & Export provides the ability to add a prefix/suffix to multiple attribute values. You can also split or merge them, depending on your needs. Note that it is possible to combine these rules and apply them to numerous values in bulk. Attribute values editing is described in this article: How to Modify Attribute Values During Import and Export in Magento 2.
As for category mapping, this feature enhances the default product import in the following way: it introduces the ability to replace third-party product categories with ones used internally. Though it won’t help you with Magento 2 widgets, the feature may reduce headaches related to product data transfers.
With category mapping, you can modify information from external catalogs right in the Magento 2 backend. Take a third-party product category and specify a replacement:
When a necessary category is absent, create it on the fly. Choose a parent category and type a new name. That’s it! The procedure is described here: Category Mapping.
Attributes On The Fly
If your data file doesn’t have all attributes, it is no longer a problem. The Improved Import & Export module offers a feature that fixes this issue. It lets you create attributes on the fly, adding missing information to data files. Use this general form:
We describe this procedure here: Product attributes import.
Extended Connectivity Options
Improved Import & Export introduces extended connectivity options that mainly expand the default data transfer opportunities of Magento 2. Let’s describe all the enhancements.
Multiple File Standards
Another notable improvement is related to file archives: the plugin can unzip compressed data automatically. As a result, there is no need to extract updates before transferring them to Magento 2.
Multiple File Sources
Support for numerous file sources is another essential improvement available with our extension. To make your data transfers flawless, it lets you streamline the following sources:
- FTP/SFTP (both local or remote servers are under your disposal);
- Dropbox (you may also leverage Box, iCloud, Google Drive, OneDrive, and Amazon Drive);
- Direct URL uploads are possible as well.
Alternative Ways of Import & Export
File transfers are not the only way of import and export. Our module also lets you leverage API connections and integration with intermediary services as more powerful types of connection. Of course, Magento 2 doesn’t offer anything like that by default.
With Improved Import & Export, you can create direct REST API connections to transfer data between your website and any third-party systems. The module lets you leverage SOAP and GraphQL if necessary.
Alternatively, you can import data from such services as Google Sheets, Office 365 Excel, and Zoho Sheet. Our extension connects to them, transferring updates. Below, you can see an example of Google Sheets integration:
Also, note that you can apply all the extension’s features to the alternative connection types. Besides, the Improved Import & Export plugin offers additional opportunities with support for WSDL and WADL.
The following video displays the module in action:
You must admit that adding and editing widgets in Magento 2 is a simple task. Furthermore, you can turn their import and export into a piece of cake with Improved Import & Export. For further information about our module, follow the link below. Don’t hesitate to contact our support to discuss your unique business case and possible customizations:'