===== Adding Buttons to DokuWiki ===== ==== What I Wanted ==== I wanted to add a "custom" button in dokuwiki, so my template would have a clearly indicated link to the legal information ("mentions légales" in French). ==== What I Discovered ==== * one cannot use a call to tpl_button() because it only works for actions that are hard-coded into its select/case structure. * one can use %%html_btn($name,$id,$akey,$params,$method='get',$tooltip='')%% ^ $name :| important, this is concatenated to 'btn_' to use as a key in a lookup in the active lang file to obtain the label for the button. | | *| must therefore ensure the label key/value pair is in the lang file. | | *| probably must also ensure it ($name) doesn't have any whitespace in it.| ^ $id :| page_name (I think), like 'mentions_legales' | ^ $akey :| access key (probably not always useful nor obvious). | ^ $params :| array('do' => 'show') | ^ $method='get' :| | ^ %%$tooltip=''%% :| skip, to remain language independent? | ==== What I Did ==== - Added the following statement to the list of buttons in my template sidebar: %%