Loading...
 

MoveLoginForm

arrow 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:
Copy to clipboard
{tr}This is{/tr} Tiki v1.8.3 (CVS) -Polaris- 2002-2004 {tr}by the{/tr} {tr}Tiki community{/tr} {if $feature_calendar eq 'y' and $tiki_p_view_calendar eq 'y'} {$smarty.now|tiki_short_datetime} {else} {$smarty.now|tiki_short_datetime} {/if} {if $tiki_p_admin eq 'y' and $feature_debug_console eq 'y'} //{tr}debug{/tr} {/if}

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 wink

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:
Copy to clipboard


btw the last hidden turns on the remember me box wink

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-
User: Pass:

Now thats looking cool! mrgreen 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}
User: Pass:
{/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! wink

Damian

Created by: Last Modification: Friday 20 September 2019 15:57:09 GMT-0000 by drsassafras
List Slides