If you are using Magento version 2.3 and want to add 'Home' and 'About' links before displaying categories in the category navigation, you might encounter challenges finding relevant information from older versions.
Here's how you can achieve this in Magento 2.3.
Understanding the Requirement
To accomplish this, we need to customize the category navigation to display 'Home' and 'About' links before the category links.
Steps to Create 'Home' Link
1. Create a Custom Module
Start by creating a custom module to override the navigation block and template files.
2. Override Block
Topmenu block to modify the category navigation.
3. Add Home Link
Modify the block to include the 'Home' link before the categories.
4. Modify Template
Update the top menu template to position the 'Home' link in the desired location.
Here's a glimpse of the code changes needed for the custom module:
<plugin name="add_home_link" type="YourVendor\YourModule\Block\Topmenu\BeforeGetHtml" />
Adding 'About' Link
Adding the 'About' link follows a similar approach as adding the 'Home' link, with appropriate modifications in the module files.
When implementing these changes, ensure that the module follows Magento best practices and does not interfere with other functionalities.