This document was imported from mods.tiki.org to here to be integrated into the documentation and translation effort.
Details
This document describes a method of adding the login form into the tiki-top_bar template.
The Juicy Stuff
Ok, lets start by looking at the default content of the tiki-top_bar:
Really this wants to be tidied up to your own taste, so heres a variation:Copy to clipboard {tr}This is{/tr} Tiki -Polaris-
A little better for what we want to do
Now we need to extra the good stuff from templates/modules/mod-login_box.tpl, here I only want the 2 fields and the button to send the form, so we need to accomodate this:
btw the last hidden turns on the remember me box
Now if we combine the two into a table we get something like this for the tiki-top_bar.tpl:Copy to clipboard
{tr}This is{/tr} Tiki -Polaris- |
|
Now thats looking cool! However when someones logged in they still see the login boxes and now welcome Mr X and a signout button. So heres the final version, with a smarty IF to check if the user is logged in or not: Copy to clipboard
{tr}This is{/tr} Tiki -Polaris- |
{if $user}Welcome: {$user} {tr}Sign Out{/tr}
{else}
{/if} |
Hope that helps everyone!
p.s. To change styles you can always add or modify the existing values in your CSS file:
Copy to clipboard input {color : #000000;
background: #EEEEEE;
font: normal 10px Verdana, Arial, Helvetica, sans-serif;
border: 1px solid #999999;
}
input[type=submit] {
-moz-border-radius: 0.8em;}
input[type=submit]:hover { color: #000000;
background-image: url(mods/tab-active.jpg);
}
Note that tab backgrounds and moz-border-radius DONT work on Internet Explorer, hey have you tried this site under Mozilla you people!
Damian
|