@asuh I personally would include the markup needed for the comments themselves (the equivalent of what wp_list_comments
is currently printing with the default walker) in your walker class in app/comments.php
. At least for menu walkers (and I’m assuming it’s similar for comment walkers) the markup is so tightly coupled to the logic of the walker that it would probably do more harm than good to try to separate them.
That still adheres to the DRY principle, because the markup generated by the walker is still only defined in one place–the walker–and not repeated elsewhere.
If you look at some of the menu walkers for Sage that have been posted in Discourse (e.g., @MWDelaney’s Bootstrap 4 nav walker linked to in this post) you will see that’s the approach they take. The template into which the menu / comments are inserted via wp_nav_menu
or wp_list_comments
is a Blade template in the normal template location, but the markup for the menu items/comments themselves is in the walker class.