1
liomj
Multitheme XOOPS without defacer module ?
  • 2020/10/15 12:15

  • liomj

  • Just popping in

  • Posts: 94

  • Since: 2012/4/10


Hi does anyone know how to set xoops to have a different theme for different module without using Defacer module in XOOPS 2.5.10 ?

I saw this old post from the defunct xoops-tip website but its not working...the theme file is loading but the theme directory name themename is not changing
Quote:

create a new theme.html file with the following
<{php}>
      
$mod $GLOBALS['xoopsModule'];
    
$dirname = (isset($mod) ? $mod->getVar('dirname') :'system');
if (
$dirname == 'newbb') {
   
$theme='dream_on';
  } elseif (
$dirname == 'news') {
   
$theme='sunshine';
  }elseif (
$dirname == 'mylinks') {
   
$theme='imago06';
  } else {
   
$theme='7dana-rose';
}

$this->assign('themename'$theme.'/theme.html');
$this->assign('xoops_theme'$theme);
$this->assign('xoops_themecss'XOOPS_URL.'/themes/'.$theme.'/style.css');
$this->assign('xoops_imageurl'XOOPS_URL.'/themes/'.$theme.'/');
<{/
php}>
<{include 
file="$themename"}>


Create a New Theme

We created a new theme call Multi (you can name it to whatever you wish) under the theme directory - use either a FTP client or mkdir shell command.

We uploaded the newly created theme.html file into Multi theme directory. Also we uploaded the style.css file from ThemeA to the Multi directory.

Please note that style.css is not required to make your multiple themes work. Without it, all the java popup windows will not look very nice, as they can’t find a suitable style.css file under Multi theme. Javascript popup windows will only look for the style.css file under the default theme (Multi), and not under individual themes.


Enable Multiple Themes

We then went to Preferences and General Settings: selected Yes for updating theme files and selected Multi as the default theme.

Viola, we have a multi-theme site. If you have followed the steps and have not made typos and other mistakes, now you should have a multi-themed Xoops Site.

2
liomj
Re: Multitheme XOOPS without defacer module ?
  • 2020/10/15 12:58

  • liomj

  • Just popping in

  • Posts: 94

  • Since: 2012/4/10


i think i got this.. i changed all xoImgUrl to $xoops_imageurl in my themes and now its working

3
Mamba
Re: Multitheme XOOPS without defacer module ?
  • 2020/10/15 15:15

  • Mamba

  • Moderator

  • Posts: 11409

  • Since: 2004/4/23


Please note that using <{php}> tags in Smarty is not recommended, and in Smarty 3 it is disabled by default.

Defacer seems to be the best and safest way.

More info about {php} tag in Smarty: https://www.smarty.net/best_practices
Support XOOPS => DONATE
Use 2.5.11 | Docs | Modules | Bugs

Login

Who's Online

338 user(s) are online (266 user(s) are browsing Support Forums)


Members: 0


Guests: 338


more...

Donat-O-Meter

Stats
Goal: $100.00
Due Date: Nov 30
Gross Amount: $0.00
Net Balance: $0.00
Left to go: $100.00
Make donations with PayPal!

Latest GitHub Commits