Show logged in user a diffrent template

Tez Oner

#5
Eey,

maybe it can work out with calling the templates with a 'var' defined in the page or url of the page
(I use this code in my Template Framework 3 (http://revamds.com/modules/download_gallery/dlc.php?file=30) which creates a 'template-framework-layer' to have multiple styles/layouts on one template-install.

$scheme_name_var='MobileMaps';

or like this:

<link rel="stylesheet" type="text/css" href="http://www.mobilemaps.nl/templates/va_template_framework_3/css/css_index.php?scheme_name_var=MobileMaps" />

$scheme_name = $_GET['scheme_name_var'];
$scheme_name = $scheme_name;

<?php $values_path "schemes/$scheme_name/values.$scheme_name.php";include $values_path?>
<?php $scheme_path "schemes/$scheme_name/scheme.$scheme_name.css"?>


You maybe need to customize it to your own needs but can be another direction/road of thinking... ;)
The Template Framework is free to download.

Cheerz,

Tez

Tez | VA-MDS / MMO | communications
--------------------------------------------
info@va-mds.com / [url="http://va-mds.com"]http://va-mds.com[/url]

Stefek

I don't know if there is another way.
I understand your issue with two templates - but if you think over it, it may be the better solution for you.

I don't know how much both templates differ.
Maybe you need only some parts of it to be different. If so, my solution will work good for you and you will need only to rework ONE directory if you want to make changes in the future.


Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

nickname

Thank you for your reply

Yeah, but this does not work quite that pretty.
I need to move all the files, which are at the moment in to folders, to one folder, in order to load the css and the js. Also I need to rename the css and js files (because they have the same name, like in the other template).

Sure it would work, but isn't there a way to actually keep the templates seperated and still use two?

Stefek

You can make it with a standard template.

Use the index.php of your template to check if the user is logged in.



<?php
if($wb->is_authenticated()) { 

     include(
'template_visitors.php');

 }else{

     include(
'template_authenticated.php');

}
 
?>



No need to hack the core to do this.

Regards,
Stefek
[i]"Gemeinsam schafft man mehr."[/i]

[b][url=http://duden.de/rechtschreibung/gemeinsam#Bedeutung1]gemeinsam[/url][/b]
1. mehreren Personen oder Dingen in gleicher Weise gehörend, eigen
2. in Gemeinschaft [unternommen, zu bewältigen]; zusammen, miteinander
#Duden

nickname

#1
Hello,

thats pretty much my first question since... I don't know (But I am not new to WB, I use it for 3 years now and I've written various modules, so keep it advanced :wink:).

Right now I want to test a new design. But not with a testinstalation, but in real. For that I thought I would just add the option to show the loggedin user a different template, than the normal visitor.

I found where the Template is defined and there I wanned to add this function (manually, because I don't need it work perfectly)

This is in the class.frontend.php of WB 2.8.3 on line 196

// Figure out what template to use
if(!defined('TEMPLATE')) {
if(isset($this->page['template']) AND $this->page['template'] != '') {
if(file_exists(WB_PATH.'/templates/'.$this->page['template'].'/index.php')) {
define('TEMPLATE', $this->page['template']);
} else {
define('TEMPLATE', DEFAULT_TEMPLATE);
}
} else {
define('TEMPLATE', DEFAULT_TEMPLATE);
}
}


Anyone has a idea how to make this possible?

Thank you for your help