After reading the following post Magento 2: How can I add External URL in top menu

I was hoping to do something similiar .

We have a category attribute and want to display categories depending on a users logged in state. I was hoping that each of the children elements would have a canShow() function or similiar but it doesn't seem the case.

I don't really want to wrap around or replace the _getHtml function, but I don't see clean way of doing it.

Thanks in advance


I have a potential solution. I'm going to do a afterGetChildren()

inside that function i'm going to loop through the children and delete them from the tree based upon the attribute.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.