I want to adjust the header menu. It works a bit by editing topmenu.phtml, at least for the $outermostClass to add some classes but I think $childrenWrapClass has an error since in function _addSubMenu in topmenu.php it does not use the var.
Though anyway, I would need more than adding a class to submenus. I would need to make the links look like
<a href="#" class="dropdown-toggle" data-toggle="dropdown" role="button" aria-haspopup="true" aria-expanded="false">
So I would need to edit topmenu.php in any way.
How to edit the topmenu.php? It is located originally in module-theme/Block/Html/Topmenu.php
Can I place it in my theme directory somewhere simply?
Someone mentioned I would need to create a module for it. Does that mean creating a directory on the same level of Magento_Theme in my theme directory? If so then how to name that directory and where to place my topmenu.php in order to use this instead the original one?