You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
When I observe page_block_html_topmenu_gethtml_before event, just like Magento\Catalog\ObserverAddCatalogToTopmenuItemsObserver does, and add some items to the top.menu, I can't order the items I add (whether it should be displayed before or after category listing, for example).
I think it should be possible, since the "top menu" must be one of the first and most modified element on any website.
Maybe by adding a special \Magento\Framework\DataObject attribute "order" which will be used inside or before Magento\Theme\Block\Html's _getHtml method, in a way to reorder the \Magento\Framework\Data\Tree\Node before rendering it ?
Or even clearer : adding a $_position property to the Node class, and a non-mandatory variable to the Node class constructor, which could be used in a similar way I expressed before ?
Simple, non-breaking, no performance issue, really useful. Right ?
I can try to make a pull request if you accept this issue.
The text was updated successfully, but these errors were encountered:
When I observe
page_block_html_topmenu_gethtml_before
event, just likeMagento\Catalog\ObserverAddCatalogToTopmenuItemsObserver
does, and add some items to thetop.menu
, I can't order the items I add (whether it should be displayed before or after category listing, for example).I think it should be possible, since the "top menu" must be one of the first and most modified element on any website.
Maybe by adding a special
\Magento\Framework\DataObject
attribute "order" which will be used inside or beforeMagento\Theme\Block\Html
's_getHtml
method, in a way to reorder the\Magento\Framework\Data\Tree\Node
before rendering it ?Or even clearer : adding a
$_position
property to theNode
class, and a non-mandatory variable to theNode
class constructor, which could be used in a similar way I expressed before ?Simple, non-breaking, no performance issue, really useful. Right ?
I can try to make a pull request if you accept this issue.
The text was updated successfully, but these errors were encountered: