跳至內容
Sars' History
使用者工具
登入
網站工具
工具
顯示頁面
舊版
反向連結
最近更新
多媒體管理器
網站地圖
登入
最近更新
多媒體管理器
網站地圖
足跡:
wiki:sidebar
本頁是唯讀的,您可以看到原始碼,但不能更動它。您如果覺得它不應被鎖上,請詢問管理員。
[[http://wiki.jalakai.co.uk/dokuwiki/doku.php/tutorials/addsidebar]] ====== 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//, to your template folder. - Edit //tplfn_sidebar.php//, uncomment line 14~18, and change config 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 ''<?php ?>'' tags add the following:<code php>// include functions that provide sidebar functionality @require_once('tplfn_sidebar.php'); // determine the sidebar class $sidebar_class = "sidebar_{$conf['sidebar']['layout']}_{$conf['sidebar']['orientation']}"; </code> * Within the ''<head>'' element and adjacent to any existing style sheet ''<link>'' add the following line: <code html> <link rel="stylesheet" media="screen" type="text/css" href="<?php echo DOKU_TPL; ?>sidebar.css" /> </code> * Change the ''<body>'' tag to <code html><body class="<?php echo $sidebar_class; ?>"></code>Note: If your ''<body>'' tag already has a class modify the ''body'' tag as to look similar to:<code html><body class="myclass <?php echo $sidebar_class; ?>"></code>. * At the appropriate place within your template add the following line to display the sidebar: <code><div id="sidebar"><?php tpl_sidebar_content(); ?></div></code> The sidebar comes styled so that the above line can be placed between the closing ''</div>'' of ''div.content'' and ''<div class='clearer'> </div>'' - alter the sidebar styles as desired.
wiki/sidebar.1162700483.txt.gz
· 上一次變更: 2006/11/05 12:23 (外部編輯)
頁面工具
顯示頁面
舊版
反向連結
回到頁頂