Fullscreen
[Show/Hide Right Column]

Using the Custom Site Header for Customizing the Site Identity
This should be moved to themes.tikiwiki.org.

Custom Site Header

This is a new document and Needs Review. Specifically, the procedure described below may be now superseded at least in part by Look and Feel configuration options (for logo, site title, and so on). To go beyond the basics, then custom code is needed, and probably more advanced examples should be provided here, such as about using jQuery image rotation, etc.


Activating the Custom Site Header

  • Go to Admin panel >> feature Look and Feel (tiki-index.php?page=look) >> tab General Layout options and click checkbox Custom Site Header on.

Example for Using the Custom Site Header for a Site Logo with a Navigation Menu

For other example, how to use the Custom Site Header adding a banner logo to your site see: Look and Feel.
  • Create a horizontal navigation menu you would like to use for the top bar.
    • For information how to configure this menu see : Menu.
    • Note : To display the horizontal menu, CSS (suckerfish) menus have to be turned on in: Admin General >> Navigation.
  • Now insert the code for your image and the new navigation menu in the box for the custom site header.

The following code describes an image (your site logo) with a self created user menu beside, both at the top of your site.

<DIV class="custom_hdr">
  <A href="http://www.mywebsite.com"><IMG src="img/wiki_up/logo.gif" class="custom_hdr_img" alt="My Logo" title="Welcome to my website"></A>
    {if $user neq ''}
      <DIV style="margin-left: 200px">
        {menu id=43 css=y type=horiz}
      </DIV>
    {/if}
  </DIV>

Code author : Darkbee

Cause of if $user neq the menu is only shown, if the username is set, for example when the user is logged in. Anonymous visitors so won't see this menu at all.

  • If you don't need this function, leave if $user neq off.

  • For an other solution, restricting the visibility of the several navigation buttons in the menu for visitors and/or users see : Top Bar.

The class "custom_hdr" serves to control more precisely the different aspects of the custom header you want to define. The CSS class sits then in the CSS of the theme you are using. Alternatively you can place the CSS style definitions in the custom header code itself without defining a custom header CSS class.

To show the site logo and the menu items on the same level / in the same line you have to float the image. This can be done by writing the float style directly in the custom site header or using a separate CSS file like mentioned before.

The following code let's appear the site logo and the menu items on the same level :

<IMG src="img/path/logo.gif" style="float: left;">{menu id=43 css=y type=horiz}

Code author : Darkbee

Thanks to Darkbee for this support !
For more explanations see the forum thread :
Navigation bar using Custom Site Header
.



Contributors to this page: Gary Cunningham-Lee1539 points  , Marc Laporte9140 points  and Rontu173 points  .
Page last modified on Monday 28 June, 2010 06:47:14 UTC by Gary Cunningham-Lee1539 points .
The content on this page is licensed under the terms of the Creative Commons Attribution-ShareAlike License.

Site Language

Reference Guide

Keywords

These keywords serve as "hubs" for navigation within the Tiki documentation. They correspond to development keywords (bug reports and feature requests):



Tiki Newsletter

Delivered fresh to your email inbox!
Newsletter subscribe icon
Don't miss major announcements and other news!
Contribute to Tiki