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.

comments powered by Disqus
Home |  Documentation |  Download |  Credits |  Contact |  Login
Andromeda © Copyright 2004-2013, Licensed under the GPL Version 2