Thursday, 15 January 2015

How to alter a MENU_LOCAL_TASK tab menu in Drupal -


I have created a tabbed menu in my custom Drupal 6 module. I want to place an HTML dropdown list on the right side of the tabbed menu at the top of my module page. Some AJAX events will be changed in the list, such as changing the CRIM boundary on SQL queries, specifying 10,20,50,100 results. How do I get it without heading templates?

Thank you,

You can do this by overriding your theme: / P>

  function yourtheme_menu_local_tasks () {// Allow empty output to dropdown dropdown $ under $ dropdown = ''; // Check whether the dropdown in this menu should be added $ inject_dropdown = TRUE; // TODO: Check the logic according to your needs, e.g. Inspecting the path through ARG () wanted / injection? If ($ inject_dropdown) {// Yes, formap api $ select = array ('#type' = & gt; select ',' # title '= & gt; t (' number of results: '),' #options '= & Gt; array (' 10 ',' 20 ',' 50 ',' 100 '),); / L> L & gt; Tag to fit the rest tab list $ dropdown = '& lt; Li & gt; . Drupal_render (select $) '& lt; / Li & gt; '; } // Note: The following is a copy of the default theme_menu_local_tasks (), // (possibly empty) $ dropdown variable output $ addition = ''; If ($ primary = menu_primary_local_tasks ()) {$ output. = "& Lt; ul class = \" Tab Primary \ "& gt; \ n". $ Primary $ dropdown "& lt; / ul & gt; \ n"; } If ($ secondary = menu_secondary_local_tasks ()) {$ output. = "& Lt; ul class = \" Tab secondary \ "& gt; \ n". $ Secondary "& Lt; / ul & gt; \ n"; } Return $ Output; }  

(note: unchecked code - potential typo)


No comments:

Post a Comment