Today, we are going to introduce you to the Magento 2 CMS page hierarchy feature. Although free and paid versions of our favorite e-commerce platform are very similar to some extent, the Commerce edition introduces multiple unique features. Below, we’d like to draw your attention to the Magento CSM page hierarchy. Below, we explore this functionality in more detail as well as shed light on how to import and export Magento 2 page hierarchy data.
In the introduction to Magento page hierarchy, we provide several examples of this content type as well as explain what the Magento 2 page hierarchy node system is. After that, you will discover how to configure page hierarchy in Magento 2 in general and how to add a node to your page hierarchy in particular. We illustrate the page hierarchy node creation process, elucidate the way you add pages to the node, define the page hierarchy structure, account for page hierarchy pagination controls, and explain the corresponding menu layout. After that, the article switches to the data transfer section, where we show how to import & export Magento 2 CMS page hierarchy data. Since this process incorporates the Improved Import & Export Magento 2 extension, you will also find its features defined.
Magento 2 CMS page hierarchy is designed to improve the actual shopping experience of your buyers. With this feature, you can effortlessly organize your content pages adding pagination, navigation, and menus to the current order of things. As a result, it becomes way more convenient to navigate your e-commerce website.
Magento 2 CMS Page Hierarchy Example
To illustrate the notable improvement of the new Magento 2 feature, let’s take a look at the example provided by the official documentation – the Privacy Policy page. It illustrates how a left-side menu enables you to organize various content improving customers’ navigation between its parts (different pages).
Thus, merchants who regularly publish a large amount of content can organize their content dramatically improving the simplicity of finding the necessary information due to the Magento CMS page hierarchy.
Magento 2 CMS Page Hierarchy Node System
The Magento 2 page hierarchy system is based on nodes that can be utilized for several purposes. Firstly, the system uses them to identify related pieces of content. Secondly, nodes are designed to organize content pages into parent/child relationships.
Imagine a parent node as a folder containing child nodes and pages. That’s how it works in the Magento page hierarchy. The tree hierarchy is leveraged to display the relative position of each node and page. Thus, every single node might contain multiple other nodes and content pages. As for a single content page, it might be associated with various nodes as well as other content pages. The Magento 2 CMS page hierarchy introduces two types of relationships between them:
parent/child;
neighbor.
How to Configure Magento 2 CMS Page Hierarchy
Do the following to enable the Magento 2 CMS page hierarchy:
Go to Stores -> Settings -> Configuration;
Choose Content Management from the left panel under General;
Expand the CMS Page Hierarchy section to make changes:
– enable the hierarchy functionality;
– enable the hierarchy metadata;
– choose a default layout for the hierarchy menu.
Don’t forget to save the changes.
How to Add Node in Magento 2 Page Hierarchy
Let’s take a look at how to create a Magento 2 page CMS hierarchy node that simplifies navigation to related content pages. Note that a node does not include a content page associated with it, but it has a URL Key. Use it as a reference to any page of your website.
So, to simplify the user experience of your Magento 2 website, create a new node. Let’s organize your press releases: name the new node “Press Releases” to enable navigation to individual content pages. Access to the node can be enabled from your “About Us” page. Add the link to the section.
You can create a CMS Hierarchy Node Link to provide access to the node with the help of the Widget tool. Take a new widget and place it in a content block or page.
How to Create Magento 2 CMS Page Hierarchy Node
Find the Content section on the Admin sidebar and choose Hierarchy from the Elements subsection to create a Magento 2 CMS page hierarchy node. You will be transferred to a page with a grid that contains all CMS pages as well as several control buttons:
There is the Add Node button above the grid. Click it and do the following:
Specify your node title under Page Properties;
Enter a suitable URL Key (lowercase characters, hyphens instead of spaces).
After saving the node, it will appear as a folder in the tree above the grid:
How to Add Pages to Magento 2 Page CMS Hierarchy Node
Now, let’s see how to add pages to your Magento page hierarchy node:
To edit your hierarchy tree, click the node to open it in the edit mode.
In the CMS pages section (scroll down to see it), mark the checkbox of each page to add it to the hierarchy.
To save the addition, tap Add Selected Pages(s) to Tree. The tree will be changed as follows:
How to Define Magento 2 CMS Page Hierarchy Structure
Let’s talk about the Magento 2 CMS page hierarchy structure. You can leverage the drag-and-drop functionality of the tree to edit it. Just drag pages to change their frontend position in the menu:
To view page properties, click the node at the top of the hierarchy. The Render Metadata in HTML Head section lets you do the following:
Identify the node as the top of the hierarchy (enable the “First” option);
Display a pagination control (enable the “Next/Previous” option);
Organize the Magento 2 page hierarchy as a book (“Enable Chapter/Section”);
Assign the node to a specific book part: set “Chapter/Section” to “Chapter,” “Section,” or “Both.” Choose “None” to disable the feature: it won’t be included as part of the book.
How to Add Magento 2 CMS Page Hierarchy Pagination Controls
What about the pagination, you will ask? Well, you can add Magento 2 CMS page hierarchy pagination controls in a few clicks:
Go to Pagination Options for Nested Pages.
Set “Enable Pagination” to “Yes.”
The “Frame” field lets you enter the number of page links to be included in the pagination control.
To add more pages to skip ahead (or back) for the next set of pagination links, enter their number in the “Frame Skip” field.
How to Enable Node in Magento 2 CMS Page Hierarchy Menu Layout
To enable the node in the menu, do the following:
Go to “Page Navigation Menu Options” and set “Show in Navigation Menu” to “Yes;”
Set “Menu Layout” to “Use Default,” “Content,” “Left Column,” or “Right Column” to specify the location of the menu concerning the content;
Set “Menu Detalization” to “Only Children” – your menu will include subpages only, or “Neighbours and Children” – to include subpages and other pages of the same hierarchy level.
In “Maximal Depth,” set the maximum number of levels to be included in determining the depth of the menu.
As for “List Type” and “List Style,” you can choose either “Unordered” – menu options are not numbered, or “Ordered” – the menu options are numbered.
Now, you can proceed to “Main Navigation Menu Options” and make the node visible in the navigation menu. Set “Show in Navigation menu” to “Yes.”
Don’t forget to save the changes.
How to Import & Export Magento 2 CMS Page Hierarchy
To import and export the Magento 2 page hierarchy, you need the Improved Import & Export extension. This module lets you freely transfer this content type between the two Magento 2 websites. But before importing any data, you need to compose a CSV with the Magento 2 CMS page hierarchy data.
Magento 2 CMS Page Hierarchy Sample CSV Explained
The page hierarchy import and export files come with the following set of attributes that represent the hierarchy settings. You can get the sample files for import and export with every attribute value set from:
Firebear Studio GitHub – here you can get CSV, XML, Json, XLSX, and ODS sample files with Magento 2 CMS page hierarchy.
Now, let’s describe the attributes available in the sample CSV with Magento CMS page hierarchy data.
Attribute Name
Reference
Values
Value Example
node_id
The ID of the node
Can only contain numerals
1
parent_node_id
ID of the parent node
Can only contain numerals.
Leave empty if the node is of the highest level.
1
page_id
The ID of the CMS page if used as a node.
Must be a valid ID of the CMS page. Else, leave the field blank.
Can only contain numerals
2
identifier
URL Key of the node
Cannot contain spaces
first_node
label
Title of the node
Can contain any symbols
First Node
level
Level of the node
Can only contain numerals
1
sort_order
The sort order of the nodes inside the parent node. Defines the position of the node in the list, the lower the sort order, the higher the position
Can only contain numerals
15
request_url
Full URL path of the node, including the identifiers (URLs) of the parent nodes
Cannot contain spaces
first_node/second_node
scope
The store view the node belongs to and is displayed at
Store View Code can be found under Stores > All Stores > next, click required store view and check the “Code” column.
For example:
Store View 1,Store View 2,German Store
default
meta_first_last
Render Metadata in HTML Head – First. Defines if the first metadata is enabled for this node.
1– is enabled
0– disabled
0
meta_next_previous
Render Metadata in HTML Head – Next/Previous. Defines if the first metadata is enabled for this node.
1– is enabled
0– disabled
0
meta_chapter
Render Metadata in HTML Head – Chapter/Section. Works in conjunction with meta_section.
Defines the value selected in the Chapter/Section field.
meta_chapter=1, meta_section=1 – BOTH
meta_chapter=1, meta_section=0 – Chapter
meta_chapter=1, meta_section=0 – Section
1
meta_section
Render Metadata in HTML Head – Chapter/Section. Works in conjunction with meta_chapter.
Defines the value selected in the Chapter/Section field.
meta_chapter=1, meta_section=1 – BOTH
meta_chapter=1, meta_section=0 – Chapter
meta_chapter=1, meta_section=0 – Section
1
meta_cs_enabled
Render Metadata in HTML Head – Enable Chapter/Section. Defines if Chapter/Section functionality is enabled for this node, its sub-nodes, and pages.
1– is enabled
0– disabled
0
pager_visibility
Enable Pagination. Defines if the pagination is enabled for the node.
1– is enabled
0– disabled
1
pager_frame
Frame. Maximum number of links displayed at the time
Can only contain numerals
3
pager_jump
Frame skip. If the Current Frame Position does not cover Utmost Pages, will render the Link to the Current Position plus/minus this Value.
Can only contain numerals
2
menu_visibility
Show in the navigation menu. Defines if the node is displayed in the PAGE navigation menu
1– is displayed
0– not displayed
0
menu_excluded
Exclude from PAGE Navigation Menu
1– exclude
0– include
1
menu_layout
PAGE Menu Layout. Defines the layout of the PAGE menu
content– Content
left_column – Left Column
right_column – Right Column
If you want to use default settings, leave the column empty.
content
menu_brief
PAGE Menu Detalization. Defines which nodes should be displayed in the PAGE menu
0– Neighbours and Children
1– Only Children
1
menu_levels_down
Maximal Depth of the PAGE menu. Defines how many levels of the nodes should be displayed in the PAGE menu.
Can only contain numerals
12
menu_ordered
PAGE menu list type. Defines the order of the nodes displayed in the page menu.
0– Unordered
1– Ordered
0
menu_list_type
PAGE menu list style. Defines how the node is displayed in the PAGE menu.
0– default
1– numbers
a– lower alpha
A– upper alpha
i– lower roman
I– upper roman
a
top_menu_visibility
Show in the navigation menu. Defines if the node is displayed in the MAIN navigation menu.
1– is displayed
0– not displayed
1
top_menu_excluded
Exclude from MAIN Navigation Menu
1– exclude
0– include
1
NOTE how meta_chapter and meta_sections attributes work. They are used to define the value of a single page hierarchy setting – Chapter/Section – however there are two of them. Make sure to read the explanation if you intend to use them.
Magento 2 CMS Page Hierarchy Import
To import Magento CMS page hierarchy data, follow these steps:
Go to System -> Improved Import / Export -> Import Jobs and hit the Add New Job button.
Configure General Settings and proceed to the Import Settings section. Select Page Hierarchy data among the options of the Entity drop-down.
Configure other job sections (for instance, you can choose the import behavior, file type, and data source), save the job, and run the transfer.
The export of the Magento 2 CMS page hierarchy is pretty much the same. You need to proceed to System -> Improved Import / Export -> Export Jobs, hit the Add New Job button and configure your export profile. That’s it.
Let’s take a look at other nuances of importing and exporting page hierarchy data in Magento 2 with the help of the Improved Import & Export Magento 2 extension.
How to import and export page hierarchy to Magento 2 automatically?
If you need to transfer page hierarchy data to or from Magento 2 regularly, it is necessary to install a third-party tool. Unfortunately, the default import/export solutions don’t let you create import jobs that run on schedule. Therefore, we recommend you use the Improved Import & Export extension to import page hierarchy data to Magento 2 automatically. The extension leverages cron so that you can create a schedule of updates. Next, the module does everything for you importing and exporting data at a specified time.
How to import and export Magento 2 CMS page hierarchy from external systems?
While the default Magento 2 import mechanisms block the import of third-party data that doesn’t follow the system’s requirements, you can use the Improved Import & Export extension to circumvent these restrictions. The module lets you create a mapping scheme matching any external values to the default Magento 2 attributes. Consequently, any external data is easily adapted to the native standards of your e-commerce website. The most intriguing aspect is that you do everything right in your admin. It is also possible to apply mapping to export processes to generate the output your partners require. Thus, the Improved Import & Export extension lets you freely transfer page hierarchy data from your website.
How to import and export page hierarchy data to Magento 2 via API?
You need to use the Improved Import & Export Magento 2 extension to import page hierarchy data to Magento 2 via API. Our extension lets you create the connection between the two systems transferring any data, including page hierarchy data. Any import job provides an interface where you can specify the parameters necessary to put the two systems together. Note that it is possible to create a bi-directional API connection with our module.
How to import and export the Magento 2 CMS page hierarchy via ODS files?
If the page hierarchy data is stored in an ODS file, you no longer need to convert it to a CSV file to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import ODS files to your ecommerce website without any necessity to run the conversion. You can also export page hierarchy data using this file format.
How to import and export page hierarchy data to Magento 2 via XLSX files?
If the page hierarchy data is stored in an XLSX file, you no longer need to convert it to a CSV file to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import XLSX files to your ecommerce website without any necessity to run the conversion. You can also export page hierarchy data using this file format.
How to import and export page hierarchy data with custom attributes to Magento 2 via JSON files?
If the page hierarchy data is stored in an ODS file, you no longer need to convert it to a CSV file to fit the Magento 2 requirements. With the Improved Import & Export Magento 2 extension, it is possible to import JSON files to your ecommerce website without any necessity to run the conversion. You can also export page hierarchy data using this file format.
How to import the Magento 2 CMS page hierarchy data via compressed files?
If the page hierarchy data is stored in a compressed file, you can also transfer it to Magento 2 with the help of the Improved Import & Export extension. However, there are two requirements to follow. Firstly, your file archive should be in a ZIP or TAR format. Secondly, the compressed data should be stored in a CSV, XML, ODS, XLSX, or JSON file.
How to import the Magento 2 CMS page hierarchy from Google Sheets?
If your page hierarchy data is stored in Google Sheets, it is no longer a problem. There is no need to export it from the service and then transfer the output to Magento 2. The Improved Import & Export lets you move the corresponding information straight from Google Sheets to your e-commerce website. It is only necessary to specify the address of the corresponding data table.
How to import and export page hierarchy data to Magento 2 from Dropbox?
In addition to Google Sheets, the Improved Import & Export module lets you transfer page hierarchy data to Magento 2 from Dropbox. Your data should be stored in CSV, XML, ODS, XLSX, or JSON. If it is a compressed file, it should be in a ZIP or TAR format. You can use this file storage as your export destination.
How to import and export the Magento 2 CMS page hierarchy from Google Drive?
In addition to Google Sheets and Dropbox, the Improved Import & Export module lets you transfer page hierarchy data to Magento 2 from Google Drive. Your data should be stored in CSV, XML, ODS, XLSX, or JSON. If it is a compressed file, it should be in a ZIP or TAR format. You can use this file storage as your export destination.
Final Words
Magento 2 CMS page hierarchy is a significant improvement introduced in the Commerce edition. It dramatically simplifies the navigation on your e-commerce website, increasing the efficiency of content pages. A customer can easily find the desired information due to the tree hierarchy of the displayed content. From the merchant’s perspective, this functionality is also stunning due to the simple configuration and powerful impact on usability. And of course, you can freely transfer the Magento CMS page hierarchy between your e-commerce website and any external systems using the Improved Import & Export extension. For further information related to the import and export functionality, follow the link below and contact our support: