by Opengento See Magento 2 Module Version.
- Add your custom feature inside feature.xml file, in your Module/feature.xml (see the features.xml.template format example on this module)
- Use your feature ID on your layout, only for the block or action, thanks to the toggle propriety :
<block type="page/html_topmenu" name="catalog.topnav" toggle="feature_id" template="page/html/topmenu.phtml"/>
- Or, you can use helper function
showFeature($featureId)
See Contributors list.