History of TopBarTutorial

unfortunately our top bar is not replacable by using the web interface. you need to modify a template file by hand. hopefully this will change very soon...

the top bar is controlled by this template:
{code source=php}
kernel/templates/top_bar.tpl
{code}

for your own convenience, copy the file to your own theme directory
{code source=php}
themes/styles/<style>/kernel/top_bar.tpl
{code}

any changes found in this file will override the original file. this way you keep the original file and make upgrading easier. for more information see ThemeTutorial.

now that you have the file there, you can open in with any text editor. for your own convenience, we will maintain the original menu when you are logged in as admin but regular users will only see the custom menu.

after <div id="bittopbar"> insert:
{code()}
{if $gBitUser->isAdmin()}
{code}
and before the last </div> insert:
{code()}
{else}
<this is where the custom menu goes>
{/if}
{code}

the custom menu is a simple XHTML unordered list with a few classes set for the links and looks something like this:
{code()}
<ul id="nav" class="menu hor">
<li>
<a class="head" href="/link/to/page">Foo</a>
<ul>
<li><a class="item" href="/link/to/page">Pile</a></li>
<li><a class="item" href="/link/to/page">Of</a></li>
<li><a class="item" href="/link/to/page">Foo</a></li>
</ul>
</li>

<li>
<a class="head" href="/link/to/page">Bar</a>
<ul>
<li><a class="item" href="/link/to/page">Another</a></li>
<li><a class="item" href="/link/to/page">Pile</a></li>
<li><a class="item" href="/link/to/page">Of</a></li>
<li><a class="item" href="/link/to/page">Foo</a></li>
</ul>
</li>
</ul>
{code}

the resulting file should look something like this:
{code()}
{strip}
{* this link is for textbrowsers *}
<div id="bittopbar">
{if $gBitUser->isAdmin()}
<a style="display:none;position:absolute;top:0px;left:0px;" href="#top">{tr}go to top{/tr}</a>
<ul id="nav" class="menu hor">
<li class="m-home"><a class="item" href="{$gBitLoc.BIT_ROOT_URL}">{tr}{$siteTitle|default:"Home"}{/tr}</a></li>
{foreach key=key item=menu from=$appMenu}
{if $menu.title && $menu.titleUrl && $menu.template}
<li class="m-{$key}{if $gBitLoc.ACTIVE_PACKAGE eq $menu.adminPanel} current{/if}">
<a class="{if $gBitSystemPrefs.feature_top_bar_dropdown eq 'y'}head{else}item{/if}{if $gBitLoc.ACTIVE_PACKAGE eq $menu.adminPanel} selected{/if}" href="{$menu.titleUrl}">{tr}{$menu.title}{/tr}</a>
{if $gBitSystemPrefs.feature_top_bar_dropdown eq 'y'}
{ include file="`$menu.template`"}
{/if}
</li>
{/if}
{/foreach}
{if $gBitUser->isAdmin()}
<li class="m-admin{if $gBitLoc.ACTIVE_PACKAGE eq 'kernel'} current{/if}">
<a class="{if $gBitSystemPrefs.feature_top_bar_dropdown eq 'y'}head{else}item{/if}{if $gBitLoc.ACTIVE_PACKAGE eq 'kernel'} selected{/if}" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}Administration{/tr}</a>
{if $gBitSystemPrefs.feature_top_bar_dropdown eq 'y'}
<ul>
{foreach key=key item=menu from=$adminMenu}
<li>
<a class="head" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}{$key|capitalize}{/tr}</a>
{ include file=`$menu.tpl`}
</li>
{/foreach}
<li>
<a class="head" href="{$gBitLoc.KERNEL_PKG_URL}admin/index.php">{tr}Layout and Design{/tr}</a>
{ include file="bitpackage:kernel/menu_layout_admin.tpl"}
</li>
</ul>
{/if}
</li>
{/if}
</ul>
<div class="clear"></div>
<a style="padding:0;margin:0;border:0;" name="top"></a>
{else}
<ul id="nav" class="menu hor">
<li>
<a class="head" href="/link/to/page">Foo</a>
<ul>
<li><a class="item" href="/link/to/page">Pile</a></li>
<li><a class="item" href="/link/to/page">Of</a></li>
<li><a class="item" href="/link/to/page">Foo</a></li>
</ul>
</li>

<li>
<a class="head" href="/link/to/page">Bar</a>
<ul>
<li><a class="item" href="/link/to/page">Another</a></li>
<li><a class="item" href="/link/to/page">Pile</a></li>
<li><a class="item" href="/link/to/page">Of</a></li>
<li><a class="item" href="/link/to/page">Foo</a></li>
</ul>
</li>
</ul>
{/if}
</div>
{/strip}
{code}
^__Note__: i had to insert a space between __{__ and __include__ due to the include plugin. please don't copy and paste the above without fixing that.^

hope this helps and wish you luck!

please excuse the inconvenience caused.
Page History
Date/CommentUserIPVersion
02 Jul 2008 (10:55 UTC)
fix up my mistake, add details for top.tpl
Combat Wombat118.90.77.1068
Current • Source
mlpvolt206.248.132.1096
View • Compare • Difference • Source
mlpvolt206.248.132.1095
View • Compare • Difference • Source
xing194.152.164.454
View • Compare • Difference • Source
xing194.152.164.453
View • Compare • Difference • Source
xing194.152.164.452
View • Compare • Difference • Source
xing194.152.164.451
View • Compare • Difference • Source