Use another theme or stanard theme when logged in

General questions about CMSimple
Post Reply
sonnur
Posts: 24
Joined: Sat Dec 29, 2012 6:54 pm

Use another theme or stanard theme when logged in

Post by sonnur » Wed Aug 07, 2013 4:44 pm

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?

cmb
Posts: 14225
Joined: Tue Jun 21, 2011 11:04 am
Location: Bingen, RLP, DE
Contact:

Re: Use another theme or stanard theme when logged in

Post by cmb » Wed Aug 07, 2013 6:57 pm

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)
Last edited by cmb on Wed Aug 07, 2013 7:01 pm, edited 1 time in total.
Reason: added PS
Christoph M. Becker – Plugins for CMSimple_XH

sonnur
Posts: 24
Joined: Sat Dec 29, 2012 6:54 pm

Re: Use another theme or stanard theme when logged in

Post by sonnur » Wed Aug 07, 2013 7:07 pm

Thanks Christoph, just added my code at line 400 when the login.php have been included. Tried the userfuncs.php solution didn't work.

Post Reply