TopBarTutorial
a brief tutorial on how to create your own top bar
Created by: xing, Last modification: 02 Jul 2008 (10:55 UTC) by Combat Wombat
The layout of pages in bitweaver follows a typical pattern, where a top or head block spans whole the first row and then one, two or three columns of content are presented below. In the file structure, the top block is called top_bar.tpl and it is frequently the first thing changed when customizing a bitweaver site. This page will explain how to change elements in the top bar both from within the CMS' admin panels and manually by changing the template (tpl) file.
All of the above can be modified within the admin menus without changing the tpl file manually.
for your own convenience, copy the file to your own theme directory
any changes found in this file will override the original file.
When that Div finishes the Site Header H1 kicks in, followed by the Site slogan, H3.
Removing everything between the opening and closing DIV tags will result in an empty header bar. This may be preferable if you have a fancy image / flash you want to insert. Just remember that such things are not indexed by search engines.
for your own convenience, copy the file to your own theme directory
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.
after
{code()}
{else}
<this is="" where="" the="" custom="" menu="" goes="">
{/if}
{code}
first of all, create a menu using Nexus and pick the suckerfish horizontal dropdown menu style. this is the same as the one currently in use. if you don't like this menu, or you feel it is too buggy, you might have to create your own Nexus plugin (see the NexusPackage page for details).
once you have picked a name for the nexus menu and you have created a new menu, Nexus creates a cached file. you can now copy the cached file to the same folder as your top_bar.tpl file.
the file will look something like:
{code()}
{tikimodule title=...}<very hard="" to="" read="" menu="" stuff="" in="" here="">{/tikimodule}
{code}
all you need to do now is remove everything in the first and last set of curly braces that you are left with the <very hard="" to="" read="" menu="" stuff="">.
finally, you need to modify the top_bar.tpl file to include the file you just created in your top bar:
{code()}
<this is="" where="" the="" custom="" menu="" goes="">
changes to:
{ include file="bitpackage=kernel/
{code}
{code()}
{strip}
{* this link is for textbrowsers *}
{if $gBitUser->isAdmin()}
{tr}go to top{/tr}
{else}
{/if}
{/strip}
{code}
hope this helps and wish you luck!
please excuse the inconvenience caused.
</this></very></very></this>
Top Bar | ||
Left Column | Centre Column | Right Column |
Bottom Bar | ||
Bottom bar 2? |
Elements of the top bar.
In the default theme that bitweaver installs with, the top bar includes- a pre-title header (small font)
- a logo, followed by the name of the site.
- a slogan (optional) in small font beneath the site name.
- a login field, justified right.
- a css driven horizontal menu (suckerfish)
All of the above can be modified within the admin menus without changing the tpl file manually.
- to change the header and the site name goto Admin-->Kernel-->Server Settings-->Page Settings "Site Title" and "Site Slogan"
- to change the site name in the horizontal menu goto Admin-->Kernel-->General Settings-->Miscellaneous "Menu Title"
- to change the menu items goto Nexus-->Menus--> Create/Edit menus - here you will have to create a new menu and prepend, append or replace the existing horizontal suckerfish menu (all the other menus apply to something else)
Where does the Title, Slogan, and User Greeting come from?
the top is controlled by this template:
<?php
kernel/templates/top.tpl
?>
for your own convenience, copy the file to your own theme directory
<?php
themes/styles/<style>/kernel/top.tpl
?>
any changes found in this file will override the original file.
Editing the Top file
Under the Div id bittop, is a new DIV, holding the user greeting.When that Div finishes the Site Header H1 kicks in, followed by the Site slogan, H3.
Removing everything between the opening and closing DIV tags will result in an empty header bar. This may be preferable if you have a fancy image / flash you want to insert. Just remember that such things are not indexed by search engines.
Where does the top bar come from?
the top bar is controlled by this template:
<?php
kernel/templates/top_bar.tpl
?>
for your own convenience, copy the file to your own theme directory
<?php
themes/styles/<style>/kernel/top_bar.tpl
?>
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.
Editing the top bar file
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
insert:
{code()}
{if $gBitUser->isAdmin()}
{code}
and before the last
insert:{code()}
{if $gBitUser->isAdmin()}
{code}
and before the last
{code()}
{else}
<this is="" where="" the="" custom="" menu="" goes="">
{/if}
{code}
Use Nexus
if you really don't want to create a menu by hand, you can (with some modifications of the files), use nexus.first of all, create a menu using Nexus and pick the suckerfish horizontal dropdown menu style. this is the same as the one currently in use. if you don't like this menu, or you feel it is too buggy, you might have to create your own Nexus plugin (see the NexusPackage page for details).
once you have picked a name for the nexus menu and you have created a new menu, Nexus creates a cached file. you can now copy the cached file to the same folder as your top_bar.tpl file.
the file will look something like:
{code()}
{tikimodule title=...}<very hard="" to="" read="" menu="" stuff="" in="" here="">{/tikimodule}
{code}
all you need to do now is remove everything in the first and last set of curly braces that you are left with the <very hard="" to="" read="" menu="" stuff="">.
finally, you need to modify the top_bar.tpl file to include the file you just created in your top bar:
{code()}
<this is="" where="" the="" custom="" menu="" goes="">
changes to:
{ include file="bitpackage=kernel/
- .tpl"}
{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 removing the space.Custom Menu
the custom menu is a simple XHTML unordered list with a few classes set for the links and looks something like this:
{code()}
{code}
Final Code
the resulting file should look something like this:{code()}
{strip}
{* this link is for textbrowsers *}
{if $gBitUser->isAdmin()}
{tr}go to top{/tr}
- {tr}{$siteTitle|default:"Home"}{/tr}
{foreach key=key item=menu from=$appMenu}
{if $menu.title && $menu.titleUrl && $menu.template}
{tr}{$menu.title}{/tr}
{if $gBitSystemPrefs.feature_top_bar_dropdown eq 'y'}
{ include file="`$menu.template`"}
{/if}
{/if}
{/foreach}
{if $gBitUser->isAdmin()}
{tr}Administration{/tr}
{if $gBitSystemPrefs.feature_top_bar_dropdown eq 'y'}
{foreach key=key item=menu from=$adminMenu}
{tr}{$key|capitalize}{/tr}
{ include file=`$menu.tpl`}
{/foreach}
{tr}Layout and Design{/tr}
{ include file="bitpackage:kernel/menu_layout_admin.tpl"}
{/if}
{/if}
{else}
{/if}
{/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 removing the space.
hope this helps and wish you luck!
please excuse the inconvenience caused.
</this></very></very></this>