====== 原始網址 ====== [[http://wiki.jalakai.co.uk/dokuwiki/doku.php/tutorials/addsidebar]] http://wiki.jalakai.co.uk/dokuwiki/doku.php/tutorials/sidebar ===== How To: Add a Sidebar to an existing Template ===== //These instructions assume you have a basic understanding of php, html & css and understand how to successfully create your own Dokuwiki template.// - Copy the two sidebar files, //tplfn_sidebar.php// & //sidebar.css// in //template-sidebar-rc2006-09-28.zip//((http://wiki.jalakai.co.uk/dokuwiki/doku.php/start)), to your template folder. - Edit //tplfn_sidebar.php//, uncomment line 14~18, and modify content to you want.((額外需要的修改)) - Make the following additions/changes to your template's //main.php// file: * Near the top of your template's main.php file and within the '''' tags add the following:// include functions that provide sidebar functionality @require_once('tplfn_sidebar.php'); // determine the sidebar class $sidebar_class = "sidebar_{$conf['sidebar']['layout']}_{$conf['sidebar']['orientation']}"; * Within the '''' element and adjacent to any existing style sheet '''' add the following line: * Change the '''' tag to Note: If your '''' tag already has a class modify the ''body'' tag as to look similar to:. * At the appropriate place within your template add the following line((網頁原本只寫 tpl_sidebar(),不過 tplfn_sidebar.php 裡面沒有這個函式 )) to display the sidebar: The sidebar comes styled so that the above line can be placed between the closing '''' of ''div.content'' and ''
 
'' - alter the sidebar styles as desired.