Page 1 of 1

Use another theme or stanard theme when logged in

Posted: Wed Aug 07, 2013 4:44 pm
by sonnur
Is it possible to use another theme or standard theme when admin signed in

I need this because my theme I have created does not go well with the admin panel.

In line 218 in cms.php I have tried this:

Code: Select all

if ($adm) {

$cf['site']['template']="ge1024blackred2XH";
$pth['folder']['template']=$pth['folder']['templates'].$cf['site']['template'].'/';
$pth['file']['template']=$pth['folder']['template'].'template.htm';$pth['file']['stylesheet']=$pth['folder']['template'].'stylesheet.css';
$pth['folder']['menubuttons']=$pth['folder']['template'].'menu/';
$pth['folder']['templateimages']=$pth['folder']['template'].'images/'; 

}
But the theme ge1024blackred2XH is not loaded. If I remove the if statement the ge1024blackred2XH is loaded. How can that be? Why does this if statement not work?

Re: Use another theme or stanard theme when logged in

Posted: Wed Aug 07, 2013 6:57 pm
by cmb
sonnur wrote:I need this because my theme I have created does not go well with the admin panel.
If you explain the details, it might be possible to solve the issue in the first place, so no special admin template is required.

If you need the special admin menu, you can place the following code in cmsimple/userfuncs.php:

Code: Select all

if ($adm) {
    $cf['site']['template'] = 'cmsimplexh'; // adjust to the name of the desired template
    $pth['folder']['template'] = $pth['folder']['templates'].$cf['site']['template'].'/';
    $pth['file']['template'] = $pth['folder']['template'].'template.htm';
    $pth['file']['stylesheet'] = $pth['folder']['template'].'stylesheet.css';
    $pth['folder']['menubuttons'] = $pth['folder']['template'].'menu/';
    $pth['folder']['templateimages'] = $pth['folder']['template'].'images/';
}
However, any page specific templates (Page -> Page template) will overwrite this.

PS: I've just seen your addition: the statement probably doesn't work, because $adm is not set at the moment the statement is executed. (it's hard to guess which version of CMSimple(_XH) you're using, so it's not clear what's line 218 in cms.php)

Re: Use another theme or stanard theme when logged in

Posted: Wed Aug 07, 2013 7:07 pm
by sonnur
Thanks Christoph, just added my code at line 400 when the login.php have been included. Tried the userfuncs.php solution didn't work.