Provide Contextual Links for Terms

Public

</> CopyGet raw version
php
  1. <?php
  2.  
  3. function MY_MODULE_menu_alter(&$items) {
  4. // Make taxonomy/term/%/edit available as a contextual link
  5. $items['taxonomy/term/%taxonomy_term/edit']['context'] = MENU_CONTEXT_PAGE | MENU_CONTEXT_INLINE;
  6. }
  7.  
  8. function MY_MODULE_taxonomy_term_view_alter(&$build) {
  9. // Add contextual links to terms.
  10. $term = $build['#term'];
  11. $build['#contextual_links']['taxonomy'] = array('taxonomy/term', array($term->tid));
  12. }
  13.  
  14. //In template add this
  15. <!-- wrapper needs class contextual-links-region -->
  16. <?php dpm($title_suffix); ?>