The fastest easiest way to get it right.

Selecting A Template

Once you have added a template to your site, we now have the obvious problem that Anromeda must know which one to present to your user. How does it know who sees the public template and who sees the admin x6 template?

You can tell Andromeda which template to use by putting a routine app_template() into your application/applib.php file. This routine returns the template name to Andromeda. Here is the routine used by the Andromeda documentation program:

<?php
function app_template() {
    if(LoggedIn()) return 'x6';
    return 'adocs6';
}
?>

This is a simple selection. If a user is logged in, they go to the x6 admin template. If not, they go to the public template.

Handling Public Users

In many cases you will have site employees logging in to the site who will use the x6 admin template, but you also have public members who can login, but who should stay on the public template. You can use the inGroup() function to modify your app_template() function:

<?php
function app_template() {
    if(!LoggedIn() or inGroup('customers')) {
        return 'name-of-my-public-template';
    }
    else {
        return 'x6';
    }
}
?>

For admin users, we also return 'x6' as the template, that puts them into the x6 admin screens.

User Comments

There are no user comments yet on this page.


Add A Comment

Comments will not appear until after they are moderated. Comments are usually moderated within a few hours on weekdays, but may take longer on weekends and holidays.

Name or nickname: (This will appear with your comment)


Email (this will never be displayed)


Enter your comment here. Use [b] and [/b] for bold, [i] and [/i] for italic, and [pre] and [/pre] for code samples. All literal HTML and PHP that you enter will be escaped out and displayed as you enter it.


Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2010, Licensed under the GPL Version 2