WebsiteBaker Support (2.8.x) > Templates, Menus & Design
Login box
dominic:
I probably am missing it in the wiki docs, but what is the include code for the login box?
Dominic
dominic:
--- Code: ---<?php
if(FRONTEND_LOGIN == 'enabled' AND VISIBILITY != 'private' AND $wb->get_session('USER_ID') == '') {
?>
<form name="login" action="<?php echo LOGIN_URL; ?>" method="post" class="login_table">
<?php echo $TEXT['USERNAME']; ?>:
<input type="text" name="username" style="text-transform: lowercase;" />
<?php echo $TEXT['PASSWORD']; ?>:
<input type="password" name="password" />
<input type="submit" name="submit" value="<?php echo $TEXT['LOGIN']; ?>" style="margin-top: 3px; text-transform: uppercase;" /><br />
<a href="<?php echo FORGOT_URL; ?>"><?php echo $TEXT['FORGOT_DETAILS']; ?></a>
<?php if(is_numeric(FRONTEND_SIGNUP)) { ?>
<a href="<?php echo SIGNUP_URL; ?>"><?php echo $TEXT['SIGNUP']; ?></a>
<?php } ?>
</form>
<?php
} elseif(FRONTEND_LOGIN == 'enabled' AND is_numeric($wb->get_session('USER_ID'))) {
?>
<form name="logout" action="<?php echo LOGOUT_URL; ?>" method="post" class="login_table">
<?php echo $TEXT['LOGGED_IN']; ?>
<br />
<?php echo $wb->get_display_name(); ?>
<br />
<input type="submit" name="submit" value="<?php echo $MENU['LOGOUT']; ?>" />
<br />
<a href="<?php echo PREFERENCES_URL; ?>"><?php echo $MENU['PREFERENCES']; ?></a>
<br />
<a href="<?php echo ADMIN_URL; ?>/index.php"><?php echo $TEXT['ADMINISTRATION']; ?></a>
</form>
<?php
}
?>
--- End code ---
Found this in one of the templates, does it look right?
Dominic
kweitzel:
Indeed the Login has been left out of the basic template tutorial.
In general you can take the code for the login out of any existing template we do have on offer at the add-on repository. You just need to style the output according to your template needs.
cheers
Klaus
orko3001:
Hi, I just want to add a login box onto the main body of one page. Can that be don or done or do i need to build a new template?
Vincent:
Hi Orko,
haven't tested, but I suppose it should be possible using the 'code'-section. So what you do is open the page in WB admin and click 'manage sections', add a section 'code' and paste the code there. What you'll get is a login field in the content area, unless of course you've made a section block somewhere else in your page.
The other solution you suggested yourself: make a new template and assign that one to your page.
Regards,
Vincent
Navigation
[0] Message Index
[#] Next page
Go to full version